Dylan的博客

世间所有的相遇,都是久别重逢

0%

Git Flow

安装 git-flow

1
2
3
4
5
6
7
8
$ git flow init
Initialized empty Git repository in /Users/tobi/acme-website/.git/
Branch name for production releases: [master]
Branch name for "next release" development: [develop]
How to name your supporting branch prefixes?
Feature branches? [feature/]
Release branches? [release/]
Hotfix branches? [hotfix/]

新功能开发

1.新建一个功能分支

1
2
$ git flow feature start rss-feed
Switched to a new branch 'feature/rss-feed'

2.完成一个功能

1
$ git flow feature finish rss-feed

功能合并到 dev 分支并切换到 dev 分支(在此之前 dev 分支的代码要拉到最新)

管理 releases

1.创建 releases

1
2
3
$ npm version patch
$ git flow release start 1.1.5
Switched to a new branch 'release/1.1.5'

2.完成 releases (在此之前 master 代码要拉到最新)

1
$ git flow release finish 1.1.5

推送本地代码(dev 和 master)和 tag

1
$ git push --tags

Hotfix

切到 master 分支

1
2
3
$ npm version patch (提升c位版本号)
1.git flow hotfix start 1.0.0.20121105  基于master
2.git flow hotfix finish 1.0.0.20121105 (测试完成,执行)合并到dev, master

For more information