GIT 常用命令
本文最后更新于:5 个月前
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
| git switch <branch> git checkout <branch>
git reset --soft HEAD~
git commit --amend
git revert HEAD
git checkout HEAD~ OR git checkout HEAD^
git checkout HEAD~2 OR git checkout HEAD^^ ... ...
git branch -f <branch_name> <md5sum>
git merge <branch_B>
git git-cherry-pick <md5sum1>... ...
git rebase <branchB> <branchB>
git rebase -i HEAD~4
git reset HEAD <file>...
git tag v1.0 -m "my version 1.0"
git push origin v1.0
git push origin --delete v1.0
git tag -d v1.0
git describe <ref>
git fetch
git pull
git pull --rebase
git checkout -b <local> origin/<remote>
git branch -u origin/<remote> <local>
git push origin <local>:<remote>
git fetch origin <remote>:<local>
git push origin :<remote_branch> git push origin --delete <remote_branch>
git fetch origin :<NewBranch> git checkout -b <NewBranch>
git commit --amend --no-edit -n -S
git rebase --exec 'git commit --amend --no-edit -n -S' -i <md5sum>
git checkout <branch/commit> path/to/file git checkout -- path/to/file
git reset --hard <branch/commit>
git reset --hard git reset --hard -- git reset --hard HEAD
|