新建一个分支,并切换到该分支
git checkout -b [branch]
新建一个分支,指向指定commit,但仍然停留在当前分支
git branch [branch] [commit]
建立追踪关系,在现有分支与指定的远程分支之间
git branch --set-upstream-to [branch] [remote-branch]
本地新创建的分支提交到远程
git push --set-upstream origin branch-name
合并指定分支到当前分支
git merge [branch]
选择一个commit,合并进当前分支
git cherry-pick [commit]
删除本地分支
git branch -d [branch-name]
删除远程分支
git push origin --delete [branch-name]
git branch -dr [remote/branch]
本地分支全部信息提交到远程
git push -u origin --all
git push -u origin --tag
删除本地分支中,远程仓库中已经不存在的分支
git remote prune origin