• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

eadz/Git-Flow-Example: Git flow by example

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

eadz/Git-Flow-Example

开源软件地址:

https://github.com/eadz/Git-Flow-Example

开源编程语言:


开源软件介绍:

Git Flow by example using GitHub

Initial Setup

We start with this

network-1

➜  Git-Flow-Example git:(master) git flow init

Which branch should be used for bringing forth production releases?
   - master
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/] 
Support branches? [support/] 
Version tag prefix? []

Then after pushing the develop branch to github, we get this:

network-2

Releasing The Development Version

Release branches

May branch off from: develop Must merge back into: develop and master Branch naming convention: release-*

So far, we have been working on the development version. Even though this post isn't production ready, I'm going to make a release branch using git flow.

➜  Git-Flow-Example git:(develop) git flow release start v0.1                      
Switched to a new branch 'release/v0.1'

Summary of actions:
- A new branch 'release/v0.1' was created, based on 'develop'
- You are now on branch 'release/v0.1'

Follow-up actions:
- Bump the version number now!
- Start committing last-minute fixes in preparing your release
- When done, run:

     git flow release finish 'v0.1'

When creating a release branch, it uses the current state of 'develop' branch as its base. You can make any further small commits to make it production ready, then you can run git flow release finish 'v0.1' to finish the release.

When the release is finished, the release branch will be merged to master.

Git flow feature example

Release branches

May branch off from: develop Must merge back into: develop and master Branch naming convention: release-*

Feature branches

May branch off from: develop Must merge back into: develop Branch naming convention: feature/feature_name

Feature branches are where you'll do most of your work. This chapter is a feature branch. You make your changes, and commit to the branch, and when the branch is ready, it will be merged back into develop.

➜  Git-Flow-Example git:(feature/feature_example) ✗ git flow feature help
Branches 'develop' and 'origin/develop' have diverged.
And local branch 'develop' is ahead of 'origin/develop'.
Switched to a new branch 'feature/feature_example'

Summary of actions:
- A new branch 'feature/feature_example' was created, based on 'develop'
- You are now on branch 'feature/feature_example'

Now, start committing on your feature. When done, use:

     git flow feature finish feature_example

There are quite a few options for git flow feature. You can find them buy running git flow feature help:

	git flow feature help
	usage: git flow feature [list] [-v]
	       git flow feature start [-F] <name> [<base>]
	       git flow feature finish [-rF] <name|nameprefix>
	       git flow feature publish <name>
	       git flow feature track <name>
	       git flow feature diff [<name|nameprefix>]
	       git flow feature rebase [-i] [<name|nameprefix>]
	       git flow feature checkout [<name|nameprefix>]
	       git flow feature pull <remote> [<name>]

If we push a feature branch to GitHub without releasing it(git push origin feature/feature_example), the network graph looks like this:

network-newfeature

Once we release the feature by running git flow feature finish feature_example, the changes on the feature branch are merged back into the develop branch, but not the master branch.

➜  Git-Flow-Example git:(feature/feature_example)  git flow feature finish feature_example
Switched to branch 'develop'
Merge made by recursive.
 README.markdown               |   56 +++++++++++++++++++++++++++++++++++++++++
 images/network-newfeature.png |  Bin 0 -> 14738 bytes
 2 files changed, 56 insertions(+), 0 deletions(-)
 create mode 100644 images/network-newfeature.png
Deleted branch feature/feature_example (was 5b99b47).

Summary of actions:
- The feature branch 'feature/feature_example' was merged into 'develop'
- Feature branch 'feature/feature_example' has been removed
- You are now on branch 'develop'

Once the develop branch is pushed to GitHub, network graph looks like this:

network-after-feature-merge




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap