Git-Flow is a workflow for development practice proposed by Vincent Driessen.
The aim is to standardise your development process so everyone follows the rules when adding code to the platform.
This is really important when you have large teams of people all working on the same codebase.
My examples are for Git Flow AVH as the original git-flow code is no longer maintained.
Install on linux
In your home folder
sudo $(wget --no-check-certificate -q https://raw.github.com/petervanderdoes/gitflow/develop/contrib/gitflow-installer.sh && bash gitflow-installer.sh install stable; rm gitflow-installer.sh)
Go to your git repo
Setup git flow with defaults
git flow init -d
Git flow Type:
By default you have the following types setup
hotfix – for bug fixes, merged to develop and master
feature – for new features, merged to develop only
release – for releases you are make (creates a release branch created from the ‘develop’ branch)
You normally tag against releases
TYPE: hotfix, feature or release
NAME: name of the branch, i.e. TICKET-001_create_button
git flow [TYPE] list – what features am I currently working on?
git flow [TYPE] start [NAME] – start a new feature
git flow [TYPE] publish [NAME] – publish a feature branch on Bitbucket so that others can work on it with me
git flow [TYPE] pull [NAME] – pulls changes from the remote feature branch. This will only find commits if another developer is working on the branch
git flow [TYPE] finish [NAME]
Remember: You need to push after you have finish so it gets merged into your git repo.
You can edit your setup by going to .git/config which looks like:
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true [remote "shared"] url = ../hello.git/ fetch = +refs/heads/*:refs/remotes/shared/* [gitflow "branch"] master = master develop = develop [gitflow "prefix"] feature = feature/ release = release/ hotfix = hotfix/ support = support/ versiontag = [gitflow "path"] hooks = /var/www/git/hello/.git/hooks
A good detailed explanation of how gitflow works see http://danielkummer.github.io/git-flow-cheatsheet/