Git-Flow | How it’s used and why you should

What is Git-Flow about?

Git-Flow is a workflow for using Git in a way that makes continuous software development and lifecycle much better. It was first proposed by Vincent Driessen in early 2010. He then released some scripts that integrate into the git command. However many people / companies still havent heard of it.

It incorporates the typical software lifecycle steps: feature development, releasing a version, hotfixing.
Internally, its “just” a branching model, so it works with every git repo be it only local or with the big remote ones like Github, Gitorious.

Git-Flow concept

At first Git-Flow might be a bit confusing, but once you get the hang of it you won’t want to develop without it anymore. Have a look at this image while you are reading the explanation beneath and all should come clear.

The main branches of Git-Flow are master and develop.

master is what is running on production systems and you are releasing based on master.

On develop branch all completed features are merged to as well as hotfixes. The develop branch is considered stable and you want to run your continuous integration against it.
For every new feature a feature branch is branched off develop and once its considered stable merged back into develop.
Once you reached a certain stage on develop you will start a release branch. From now on you are in release hardening state. On this branch, the only changes allowed are fixes for issues your QA team is reporting. The release branch will then be merged into master, tagged as a version and also merged back into develop and everything starts over again.
Whenever you find a bug in production that is important to be fixed and cant wait for the next release, you will start a hotfix branch off the master. This hotfix is then merged into master as well as develop.

How to get started using Git-Flow

To get your git client setup for git-flow, you only have to do

wget http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh –no-check-certificate
chmod +x gitflow-installer.sh
./gitflow-installer.sh

That was it! Now your git command knows some more things so you can use Git-Flow.

How its used

Clone a remote repository or create a new repo folder locally. Then go to the root folder of your repo and do a

git flow init

This will initialize Git-Flow on that repo.

It will ask you some questions, just accept the defaults. Basically it just adds some info to your .git/config .

You will also be automatically changed to the develop branch.

I will give you a quick overview over the rest of the commands:

git flow feature

This command set is used to handle, guess what, features. Use git flow feature start feature_name to start working on a new feature. It will automatically switch you into that feature branch.
To work collaborative/share your feature use git flow feature publish feature_name . Others can then git flow feature pull that feature branch and you can git push to it.
Once you are happy with your feature, git flow feature finish it, which will merge it into develop and then delete the feature branch. (You want to delete the feature branch manually on remote as git flow only deletes is locally).

git flow release

This command set is fairly similar to the one aboth. You can start, publish, finish a release. When you have started a release, you will only add QA / minor last-minute fixes to it. No bigger things from develop or feature branches will go in here anymore ! You also want to give the release a good name like version numbers or internal code names. When you are done, you finish it with git flow release finish -F -p release_name . This will merge the release into master and develop. -F and -p will fetch and push the release branch.

git flow hotfix

Oh great. Someone found a critical bug that cant wait for next release. Therefore you can start and finish a hotfix branch, which then gets merged into master and develop.

That was it? Simple, huh? If you wanna learn more about the commands, like special flags, have a look here https://github.com/nvie/gitflow/wiki/Command-Line-Arguments

Conclusion, or why YOU should use Git-Flow

As you can see Git-Flow integrates very easily into your existing Git. You dont have to change anything, only your workflow will be optimized. It also brings in great structure into your software lifecycle.
Its also easier to keep track of changes, as they are now grouped in your commit histoy, to features, fixes, releases.

  

github项目

Git-Flow | How it’s used and why you should的更多相关文章

  1. Git 在团队中的最佳实践--如何正确使用Git Flow

    我们已经从SVN 切换到Git很多年了,现在几乎所有的项目都在使用Github管理, 本篇文章讲一下为什么使用Git, 以及如何在团队中正确使用. Git的优点 Git的优点很多,但是这里只列出我认为 ...

  2. Git 在团队中的最佳实践--如何正确使用Git Flow[转]

    原文地址:http://www.cnblogs.com/cnblogsfans/p/5075073.html Git的优点 Git的优点很多,但是这里只列出我认为非常突出的几点. 由于是分布式,所有本 ...

  3. GIT FLOW 时序图

    git flow sequence md link: git branching model master->master branch: use default branch Note rig ...

  4. 基于git的源代码管理模型——git flow

    基于git的源代码管理模型--git flow A successful Git branching model

  5. git flow的使用

    简介 Gitflow工作流程围绕项目发布定义了严格的分支模型.尽管它比Feature Branch Workflow更复杂一些,但它也为管理更大规模的项目提供了坚实的框架. 与Feature Bran ...

  6. 引入git flow分支管理

    git flow是Vincent Driessen提出了一个分支管理的策略,非常值得借鉴.它可以使得版本库的演进保持简洁,主干清晰,各个分支各司其职.井井有条. 先看下Vincent Driessen ...

  7. git flow的安装和使用

    确保安装了git 1.windows系统下安装 进入cmd clone github上的gitflow到一个文件夹下 我这里clone到 c:\gitflow git clone git://gith ...

  8. git以及git flow 的使用

    转载:http://selfcontroller.iteye.com/blog/996494 在这里主要讲一下我在项目中用到的关于gitflow的用法.   公司的项目中,专门有一台用来存放版本库的服 ...

  9. 基于SourceTree 下的 Git Flow 模型

    基于SourceTree 下的 Git Flow 模型 1. sourceTree  是一个开源的git 图形管理工具,可下载mac版本,windows版本 2. Git Flow 是一套使用Git进 ...

  10. 从一个前端项目实践 Git flow 的流程与参考

    Git flow 出自 A successful Git branching model,这里使用了一个前端项目配合本文稿实施了 git flow 并记录流程作出示例和参考,对 hotfix 与持续部 ...

随机推荐

  1. mysql使用navicat编写调用存储过程

    在Navicat里面,找到函数,右键,新建函数,选择过程,如果有参数就填写函数,如果没有就直接点击完成 在BEGIN......END中间编写要执行的sql语句,例如下面存储过程取名为pro_data ...

  2. [openjudge-搜索]Lake Counting(翻译及实现)

    题目原文 描述 Due to recent rains, water has pooled in various places in Farmer John's field, which is rep ...

  3. JavaScript 基础,登录验证

    1.<script></script>的三种用法: a.放在<body>中 b.放在<head>中 c.放在外部JS文件中 <!DOCTYPE h ...

  4. 高性能计算linux集群常用配置

    1.检查超线程 查看线程数:grep siblings /proc/cpuinfo |uniq 查看物理核心数:grep cores /proc/cpuinfo |uniq 2.检查操作系统版本 ca ...

  5. [转载]dbms_lob用法小结

    http://blog.sina.com.cn/s/blog_713978a50100prkt.html CLOB里存的是2进制 判定长度   DBMS_LOB.GETLENGTH(col1)获取文本 ...

  6. [转载]WeeksInAYear、WeeksInYear、DaysInAYear、DaysInAMonth、DaysInYear、DaysInMonth - 获取指定年月的周、日数

    DateUtils.DaysInYear(); DateUtils.DaysInMonth(); DateUtils.DaysInAYear(); DateUtils.DaysInAMonth(); ...

  7. 使用 ffmpeg 转换视频格式

    ffmpeg 是 *nix 系统下最流行的音视频处理库,功能强大,并且提供了丰富的终端命令,实是日常视频处理的一大利器! 实例 flac 格式转 mp3 音频格式转换非常简单: ffmpeg -i i ...

  8. python的类和对象

    一.面向对象和面向过程 1.1面向过程的特点 优点是:极大的降低了写程序的复杂度,只需要顺着要执行的步骤,堆叠代码即可. 缺点是:一套流水线或者流程就是用来解决一个问题,代码牵一发而动全身. 1.2面 ...

  9. Java的类的详解

    首先呢,我承认上一次我理解的有误. 1.构造方法的作用:是初始化一个对象,而不是成员变量,它和get和set方法都有给成员变量赋值的功能. 2.下来说一下JVM调用main方法的过程: a.静态变量赋 ...

  10. Kattis之旅——Inverse Factorial

    题目意思就是已知n的阶乘,求n. 当输入的阶乘小于10位数的时候,我们可以用long long将字符串转化成数字,直接计算. 而当输入的阶乘很大的时候,我们就可以利用位数去大概的估计n. //Asim ...