Git指令速記
Git指令速記 (因為太常忘記了)
git branch
- branch: git branch
git branch
- delete a branch
git push origin --delete
- local branch to remote:
git push -u origin {branch_name}
tag
list tag:
git tag
打tag:
push all tag到remote:
git push origin --tags
checkout remote tag:
git checkout tags/version {version number}
git checkout
checkout remote branch (new version git):
git fetch
git checkout
git revert
// revert code to specific point you want to keep
git reset --hard {hash}
// move branch pointer back to previous HEAD
git reset --soft HEAD@{1}
// remember commit revert change
git commit -m "revert to {hash}"