Use Git-flow to help manage Git code

Source: Internet
Author: User
Tags switches git clone

I'm not familiar with git, often put git commit messy, resulting in a lot of useless commit in master, finally decided to take a good look at git tutorial, but accidentally found that there is also a git-flow tool to help me manage the GIT project code.

Git-flow is easier to use on Ubuntu. First installed, can be obtained by Apt-get. The order is as follows:

sudo apt-get install Git-flow


If you are under Windows, you can refer to this article for installation: http://my.eoe.cn/sunxun/archive/158.html

If your git has been installed, it is much more convenient to download the two address files below and extract the Getopt.exe and Libintl3.dll into the bin directory of Git's installation directory.

Http://sourceforge.net/projects/gnuwin32/files/util-linux/2.14.1/util-linux-ng-2.14.1-bin.zip/download

Http://sourceforge.net/projects/gnuwin32/files/util-linux/2.14.1/util-linux-ng-2.14.1-dep.zip/download

Then check out the Gitflow item on the GitHub, as follows:

git clone--recursive git://github.com/nvie/gitflow.git
Enter and execute inside the Contrib\msysgit-install.cmd, prompt replication success, it is OK.


The next step is to initialize the project. I have executed the following command on my old Git project to initialize:

git flow init

It will create or convert a new version of the branch structure, of course, in the initialization process, will ask the following questions, I have chosen the default:

Which Branch should is used for bringing forth production?
   -Master
Branch name for production releases: [Master]
Branch name for ' next release ' development: [Develop]

H ow to name your supporting branch prefixes?
Feature branches? [Feature/]
Release branches? [release/]
Hotfix branches? [hotfix/]
Support branches? [support/]
Version tag prefix? []

When you're done, you can see it creates a develop branch for us by using the git branch command.

Next I will continue to use this note to add slowly.


Fix a bug.

Git Flow hotfix start 3
It creates a branch HOTFIX/3 based on master and switches to the current branch.

When the repair is complete, you can execute the following command:

git flow notfix finish 3

Add a functional feature

Git flow feature start demo

It creates a branch Feature/demo and switches to that branch.


When the function is complete:

Git Flow feature finish demo
It will have the Feature/demo branch merged into the develop branch, then switch back to the develop branch and delete the Feature/demo branch.


function complete, to merge to the main branch, you can perform

Git flow release start v0.7.0
It creates a release/v0.7.0 branch and switches to that branch.

And then you test it here. If the test is not a problem, execute the following command:

Git flow release finish v0.7.0
It merges the contents of the release/v0.7.0 branch into the master branch and the develop branch, and the tag v0.7.0, and then deletes the release/v0.7.0 branch.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.