创建分支
- git checkout -b develop_XXX origin/develop (以远程的develop分支为基准建立自己的本地分支)
- git push origin develop_XXX(将本地develop_XXX分支提交到远程)
删除分支
1.git branch -D branchName(删除本地分支)
2. git push origin --delete branchName (删除远程分支)
merge单个commit(branch_A to branch_B)
先checkout到branch_A , 从branch_B merge单个commit到branch_A
git checkout branch_A
git cherry-pick commitId
git-更改本地和远程分支的名称
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
回退到指定版本
git reset --hard commitId
强制提交到master分支
git push -f -u origin master