參考
(21條消息) Git分支命名規(guī)范_嘻嘻哈哈111111的博客-CSDN博客_git 分支命名
重置提交后的強(qiáng)推代碼
git push --force origin[branch name]
merge錯(cuò)誤
切換到主分支:
1.git pull
2.git fetch -p
切換到當(dāng)前分支:
1.git branch --unset-upstream
2.git pull
3.git branch --set-upstream-to=origin/<master branch> <current branch>
本地創(chuàng)建新分支
git checkout -b <branch name>
Cherry-pick
(21條消息) git cherry-pick指令詳解_Nice2cu_Code的博客-CSDN博客_git pick


rebase
開(kāi)發(fā)分支:git rebase [主分支]
如果產(chǎn)生沖突,會(huì)切換到一個(gè)解決沖突的commit上
解決沖突后,git add [沖突文件...]
git rebase --continue
revert
刪除指定的commit:git revert [commit id]
刪除后會(huì)進(jìn)入新的commit
查看
使用git show <commit-hash>來(lái)查看某次提交的詳細(xì)信息和修改內(nèi)容
使用git diff <commit-hash>來(lái)查看該提交和當(dāng)前狀態(tài)之間的差異
使用git show --name-only <commit-hash>來(lái)查看修改的文件列表
使用git show <commit-hash> -- <file-path>來(lái)查看某個(gè)特定文件的修改