zoukankan      html  css  js  c++  java
  • Git-Flow | How it’s used and why you should

    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项目

  • 相关阅读:
    location.href使用方法总结
    Ubuntu 12.04 安装JDK 8和Eclipse
    【一】仿微信飞机大战cocos2d-x3.0rc1
    QTP的基本功能介绍
    Spring+Ibatis集成开发实例
    Java NIO与IO的差别和比較
    嵌入式Linux常见问题
    递归和迭代之间的差
    大约sources.list和apt-get [转载]
    JVM学习笔记(一)------的基本结构
  • 原文地址:https://www.cnblogs.com/panpanwelcome/p/9777527.html
Copyright © 2011-2022 走看看