git-flow is a branching model to keep your git repository in shape, and the author @nvie also released it as git extensions, so that you can easily convert your git repository into git-flow branch structure and keep maintained (with ease).
Below are the steps I setup git-flow on my Mac OS X Lion:
Install bash-completion
% sudo port install bash-completion
Add following line into .bash_profile, so that you can use default completions
[ -f /opt/local/etc/bash_completion ] && . /opt/local/etc/bash_completion
After bash-completion is ready, you still need two additional completions before installing gitflow extensions.
Install git-bash-completion
% curl -O https://github.com/git/git/raw/master/contrib/completion/git-completion.bash -o ~/.git-completion.sh
Enable git-bash-completion by adding following into .bash_profile
[ -f ~/.git-bash-completion.sh ] && . ~/.git-bash-completion.sh
Install git-flow-completion
% curl -O https://github.com/bobthecow/git-flow-completion/raw/master/git-flow-completion.bash -o ~/.git-flow-completion.sh
Again, add following into .bash_profile to enable it
[ -f ~/.git-flow-completion.sh ] && . ~/.git-flow-completion.sh
Once you completed steps above, the git and git-flow completions are integrated into bash, so we can proceed to the final step, install the git-flow git extensions:
% git clone --recursive git://github.com/nvie/gitflow.git
% sudo make prefix=/opt/local install
That’s it.
For usage, read this article.
If you don’t mind installing dependent packages, you can use:
% sudo port install git-flow
Which saves lots of times, if it doesn’t break build.
loading…