前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Git Flow 咀嚼:git flow 对应的git实现

Git Flow 咀嚼:git flow 对应的git实现

作者头像
大数据工程师-公子
发布2019-03-14 15:40:21
3830
发布2019-03-14 15:40:21
举报

Git Flow 代码示例

接触git flow也有很长一段时间了,中途偶尔用了一下,由于自己的手上的项目也不是大型项目,基本都是两三个人在做,master主要还是我自己,用git flow反而比较麻烦。也没有对这个原理进行深入理解。正好这段时间接手了一个项目,想试试git flow,然后就又了解了一下。git flow 的流程,可以用下面纯git命令来实现。

a. 创建develop分支

git branch develop
git push -u origin develop    

b. 开始新Feature开发

git checkout -b feature1 develop
# Optionally, push branch to origin:

git push -u origin feature1    

# 做一些改动    
git status
git add some-file
git commit    

c. 完成Feature

git pull origin develop
git checkout develop
git merge --no-ff feature1
git push origin develop

git branch -d feature1


# If you pushed branch to origin:
git push origin --delete feature1    

d. 开始Relase

git checkout -b release-0.1.0 develop

# Optional: Bump version number, commit
# Prepare release, commit

e. 完成Release

git checkout master
git merge --no-ff release-0.1.0
git push

git checkout develop
git merge --no-ff release-0.1.0
git push

git branch -d release-0.1.0

# If you pushed branch to origin:
git push origin --delete release-0.1.0   


git tag -a v0.1.0 master
git push --tags

f. 开始Hotfix

git checkout -b hotfix-0.1.1 master

### g. 完成Hotfix

git checkout master
git merge --no-ff hotfix-0.1.1
git push


git checkout develop
git merge --no-ff hotfix-0.1.1
git push

git branch -d hotfix-0.1.1

git tag -a v0.1.1 master
git push --tags

我的博客即将同步至腾讯云+社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=3ckgexxns8g0o

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017年07月25日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Git Flow 代码示例
    • a. 创建develop分支
      • b. 开始新Feature开发
        • c. 完成Feature
          • d. 开始Relase
            • e. 完成Release
              • f. 开始Hotfix
              领券
              问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档