全文xxx表示你的分支名
git branch -d xxx
git push origin --delete xxx
本地分支
git branch
本地及远程分支
git branch -a
所有分支的情况
git remote show origin
git remote prune origin
先切换到合并后分支,例如develop
git checkout develop
再同步远端代码
git pull origin develop
再合并指定分支代码到当前分支
git merge --no-ff xxx
再提交到远端
git push origin devleop
git flow feature start xxx
git flow feature finish xxx
会将此feature分支代码合并到develop,并删除这个feature
相当于
$ git checkout develop
$ git merge --no-ff feature/xxx
$ git branch -d feature/xxx
git flow release start xxx
git flow release finish xxx
会将代码 merge到 master和 develop分支,并删除这个release
举例,当前开发版本为v1.1.0
,相当于
$ git checkout master
$ git merge --no-ff release/xxx
$ git tag -a v1.1.0
$ git checkout develop
$ git merge --no-ff release/xxx
$ git branch -d release/xxx
push 主干 master 分支,并打 tag
$ git checkout master
$ git push
$ git push origin v1.1.0
push 开发 develop 分支
$ git checkout develop
$ git push
原文:https://www.cnblogs.com/diffx/p/11131495.html