git flow操作流程

1、新git clone的代码需要初始化(默认就行)
git flow init
2、创建feature开发分支
#切换到develop分支
git checkout develop
#拉取最新代码
git pull
#创建feature开发分支
git flow feature start 分支名字
#推送feature开发分支到远程仓库
git flow feature publish 分支名字
#推送
git push

##################################
#    开始开发,开发完执行以下操作     # 
##################################

#如果develop有新代码需要merge
git merge develop
git push
#将feature开发分支合并到develop分支,并且删除本地feature/name分支。
git flow feature finish 分支名字
#推送到远程
git push
3、创建release发布分支,并合并到master
git checkout develop
git pull
git flow release start 分支名字
git flow release publish 分支名字
git push
git flow release finish 分支名字
git push
4、查看当前分支改动
git diff develop
5、还原本地分支代码
git checkout .
6、删除本地、远程分支
#删除本地分支
git branch -d name
#删除远程分支
git push origin --delete name
7、查看版本号
git log
8、撤销
#撤销到某一个版本上
git reset --hard 版本号
#撤销工作区到上一个版本
git reset --hard HEAD^

您可以选择一种方式赞助本站

目前评论:1   其中:访客  1   博主  0

  1. 大福 0
评论加载中...

发表评论取消回复

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: