git基本命令集合

以下内容不适合初学者

括号中表示需要自己填写

v1.0

git add
git commit -m
git commit -a -m
git commit -amend
git clone
git log
git log --pretty=oneline
git checkout -- file
git reset HEAD
git remote
git remote -v
git remote add (pb) (xxxxxxxxx.git)
git remote rm (pb)
git fetch (origin branch)

v1.1

git tag
git tag -a (v1.0) -m "(command annotation)"
git tag show (v1.0)
git tag -a v1.1 (a740405ee465a86e6ed5e65df9b3a501f387bfc9)
git push origin (v1.0)
git push origin --tags
git config --global alias.(co) (commit)

v2.0

git branch
git branch -v
git branch -b (new_branch)
git checkout (new_branch)
git checkout -b (new_branch)
git checkout -b (new_branch) (origin/branch)
git branch -D
git merge (dev_branch)
git fetch origin
git push origin (local_branch)
git push origin :(remote_branch)
git push origin (local_branch):(remote_branch)

//修改历史标签
git rebase -i HEAD~3
pick-->edit//将上面命令所展示的提交历史页面,将pick修改为edit
git commit -amend
git reabse --continue

v2.1

git merge (dev_branch)
git rebase (dev_branch)
git rebase (master_branch) (dev_branch)
git rebase --onto (master_branch) (service_branch) (client_branch)

//confict fix
git add .
git rebase --continue
//cancel rebase
git rebase
//pull rebase
git pull rebase

v3.0

git stash
git stash list
git stash apply
git stash pop

如果有什么疑问可以留言哦

posted @ 2017-07-18 13:38  逆倒尘光  阅读(173)  评论(0编辑  收藏  举报