參考
(21條消息) Git分支命名規范_嘻嘻哈哈111111的博客-CSDN博客_git 分支命名
重置提交后的強推代碼
git push --force origin[branch name]
merge錯誤
切換到主分支:
1.git pull
2.git fetch -p
切換到當前分支:
1.git branch --unset-upstream
2.git pull
3.git branch --set-upstream-to=origin/<master branch> <current branch>
本地創建新分支
git checkout -b <branch name>
Cherry-pick
(21條消息) git cherry-pick指令詳解_Nice2cu_Code的博客-CSDN博客_git pick
rebase
開發分支:git rebase [主分支]
如果產生沖突,會切換到一個解決沖突的commit上
解決沖突后,git add [沖突文件...]
git rebase --continue
revert
刪除指定的commit:git revert [commit id]
刪除后會進入新的commit
查看
使用git show <commit-hash>來查看某次提交的詳細信息和修改內容
使用git diff <commit-hash>來查看該提交和當前狀態之間的差異
使用git show --name-only <commit-hash>來查看修改的文件列表
使用git show <commit-hash> -- <file-path>來查看某個特定文件的修改