A collection of Git extensions to provide high-level repository operations for Vincent Driessen's branching model.
Includes customisations to adapt it to our use case:
- Delete remote on feature finish
- Force pull from develop branch before feature start if diverged
- Force pull from master branch before hotfix start if diverged
- Push to origin after performing finish
- Use current branch when not specified in command line
- Fetch from origin before performing finish
- Squash feature during merge
- Do not tag releases
For the best introduction to get started with git flow
, please read Jeff
Kreeftmeijer's blog post:
http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/
Or have a look at one of these screen casts:
- A short introduction to git-flow (by Mark Derricutt)
- On the path with git-flow (by Dave Bock)
Use the following command:
$ wget --no-check-certificate -q -O - https://github.com/coverfy/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh
By default, git-flow will be installed in /usr/local.
If you want autocompletion for the git flow commands, we have forked the git-flow-completion project. Just install it and avoid some keypresses :)
git-flow is published under the liberal terms of the BSD License, see the LICENSE file. Although the BSD License does not require you to share any modifications you make to the source code, you are very much encouraged and invited to contribute back your modifications to the community, preferably in a Github fork, of course.
To initialize a new repo with the basic branch structure, use:
git flow init
This will then interactively prompt you with some questions on which branches you would like to use as development and production branches, and how you would like your prefixes be named. You may simply press Return on any of those questions to accept the (sane) default suggestions.
-
To list/start/finish feature branches, use:
git flow feature git flow feature start <name> [<base>] git flow feature finish <name>
For feature branches, the
<base>
arg must be a commit ondevelop
. -
To list/start/finish hotfix branches, use:
git flow hotfix git flow hotfix start <release> [<base>] git flow hotfix finish <release>
For hotfix branches, the
<base>
arg must be a commit onmaster
.