blob: 5bab435ae1ebedb69cf6483c863fd28c4904cec9 [file] [log] [blame]
Vincent Driessen877f5fe2010-12-06 14:54:50 -08001git-flow ![Project status](http://stillmaintained.com/nvie/gitflow.png)
Vincent Driessen6c2d30b2010-01-26 22:18:36 +01002========
Vincent Driessen12c4ab42010-01-26 22:11:19 +01003A collection of Git extensions to provide high-level repository operations
Vincent Driessen4fc0bc12010-02-24 01:43:04 +01004for Vincent Driessen's [branching model](http://nvie.com/git-model "original
Vincent Driessen78c73dc2010-01-21 00:48:44 +01005blog post").
6
Vincent Driessenf206ba62010-01-26 12:44:41 +01007
Vincent Driessen553776f2011-01-31 22:43:06 +01008Getting started
9---------------
10For the best introduction to get started with `git flow`, please read Jeff
11Kreeftmeijer's blog post:
12
13[http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/)
14
15Or have a look at one of these screen casts:
16
Vincent Driessen766159d2011-11-24 13:02:00 +010017* [How to use a scalable Git branching model called git-flow](http://buildamodule.com/video/change-management-and-version-control-deploying-releases-features-and-fixes-with-git-how-to-use-a-scalable-git-branching-model-called-gitflow) (by Build a Module)
Vincent Driessen553776f2011-01-31 22:43:06 +010018* [A short introduction to git-flow](http://vimeo.com/16018419) (by Mark Derricutt)
19* [On the path with git-flow](http://codesherpas.com/screencasts/on_the_path_gitflow.mov) (by Dave Bock)
20
21
Vincent Driessen12c4ab42010-01-26 22:11:19 +010022Installing git-flow
23-------------------
Alexander Große26bfbc2010-11-02 14:05:44 +010024
25### Mac OS
26If you're on a Mac and use [homebrew](http://github.com/mxcl/homebrew), it's simple:
Vincent Driessen149d1542010-10-20 22:11:25 +020027
28 $ brew install git-flow
29
Alexander Große26bfbc2010-11-02 14:05:44 +010030If you're on a Mac and use [MacPorts](http://macports.org/), it's simple:
Vincent Driessen149d1542010-10-20 22:11:25 +020031
32 $ port install git-flow
33
Alexander Große26bfbc2010-11-02 14:05:44 +010034### Linux, etc.
Vincent Driessen149d1542010-10-20 22:11:25 +020035Another easy way to install git-flow is using Rick Osborne's excellent git-flow
36installer, which can be run using the following command:
Vincent Driessen4f0f5392010-07-10 17:05:27 +020037
Tacit Sawk26293bb2011-06-14 10:51:43 +100038 $ wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo bash
Vincent Driessen4f0f5392010-07-10 17:05:27 +020039
Alexander Große26bfbc2010-11-02 14:05:44 +010040### Windows
Olivier Menguéb52f79e2011-03-20 20:34:39 +010041
42For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good
43starting place for installing git.
44
Alexander Große26bfbc2010-11-02 14:05:44 +010045#### Using Cygwin
46For Windows users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/)
47first to install tools like `git`, `util-linux` and `wget` (with those three being packages that can be selected
48during installation). Then simply run this command from a Cygwin shell:
JP Totoea738ef2010-08-20 04:56:57 +080049
Tacit Sawk26293bb2011-06-14 10:51:43 +100050 $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | bash
JP Totoea738ef2010-08-20 04:56:57 +080051
Alexander Zeitlerc02c12d2011-12-06 21:38:04 +010052If you get the error "flags: FATAL unable to determine getopt version" error after
53
54 $ git flow init
55
56you need to install the util-linux package using the Cygwin setup.
57
58
Olivier Menguéb52f79e2011-03-20 20:34:39 +010059#### Using [msysgit](http://code.google.com/p/msysgit/)
Mark Borcherdinge73a1d92011-07-08 11:29:10 -050060Download and install `getopt.exe` from the [util-linux package](http://gnuwin32.sourceforge.net/packages/util-linux-ng.htm) into `C:\Program Files\Git\bin`. (Only `getopt.exe`, the others util-linux files are not used). Also install `libintl3.dll` from the Dependencies package, into the same directory.
Alexander Große26bfbc2010-11-02 14:05:44 +010061
Olivier Menguéb52f79e2011-03-20 20:34:39 +010062Clone the git-flow sources from GitHub:
Alexander Große26bfbc2010-11-02 14:05:44 +010063
Vincent Driessen69f205c2011-02-11 09:15:18 +010064 $ git clone --recursive git://github.com/nvie/gitflow.git
Olivier Menguéb52f79e2011-03-20 20:34:39 +010065 $ cd gitflow
Alexander Große26bfbc2010-11-02 14:05:44 +010066
Olivier Menguéb52f79e2011-03-20 20:34:39 +010067Run the `msysgit-install` script from a command-line prompt (you may have to
68run it with "Full Administrator" rights if you installed msysgit with its
69installer):
Alexander Große26bfbc2010-11-02 14:05:44 +010070
Olivier Menguéb52f79e2011-03-20 20:34:39 +010071 C:\gitflow> contrib\msysgit-install.cmd
Alexander Große26bfbc2010-11-02 14:05:44 +010072
73### Manual installation
Vincent Driessen69f205c2011-02-11 09:15:18 +010074If you prefer a manual installation, please use the following instructions:
Vincent Driessen13c94822010-02-15 20:09:02 +010075
Vincent Driessen69f205c2011-02-11 09:15:18 +010076 $ git clone --recursive git://github.com/nvie/gitflow.git
Vincent Driessen13c94822010-02-15 20:09:02 +010077
78Then, you can install `git-flow`, using:
Vincent Driessenf206ba62010-01-26 12:44:41 +010079
Vincent Driessen12c4ab42010-01-26 22:11:19 +010080 $ sudo make install
Vincent Driessenf206ba62010-01-26 12:44:41 +010081
Vincent Driessene0b54c02010-03-19 19:27:38 +010082By default, git-flow will be installed in /usr/local. To change the prefix
83where git-flow will be installed, simply specify it explicitly, using:
Vincent Driessen12c4ab42010-01-26 22:11:19 +010084
Vincent Driessene0b54c02010-03-19 19:27:38 +010085 $ sudo make prefix=/opt/local install
Vincent Driessendd720be2010-01-27 00:00:09 +010086
87Or simply point your `PATH` environment variable to your git-flow checkout
88directory.
Vincent Driessenf206ba62010-01-26 12:44:41 +010089
Vincent Driessenb17b8982010-08-25 21:25:36 +020090*Installation note:*
91git-flow depends on the availability of the command line utility `getopt`,
92which may not be available in your Unix/Linux environment. Please use your
93favorite package manager to install `getopt`. For Cygwin, install the
Vincent Driessen47d1b9d2010-10-08 11:20:00 +020094`util-linux` package to get `getopt`. If you use `apt-get` as your install
95manager, the package name is `opt`.
Vincent Driessenb17b8982010-08-25 21:25:36 +020096
Vincent Driessenf206ba62010-01-26 12:44:41 +010097
Vincent Driessenec0b8542010-07-22 14:57:16 +020098Integration with your shell
99---------------------------
Vincent Driessen25def712010-08-25 21:25:57 +0200100For those who use the [Bash](http://www.gnu.org/software/bash/) or
101[ZSH](http://www.zsh.org) shell, please check out the excellent work on the
Vincent Driessenec0b8542010-07-22 14:57:16 +0200102[git-flow-completion](http://github.com/bobthecow/git-flow-completion) project
103by [bobthecow](http://github.com/bobthecow). It offers tab-completion for all
104git-flow subcommands and branch names.
105
Vincent Driessenec0b8542010-07-22 14:57:16 +0200106
Vincent Driessen11965b32010-09-06 12:19:20 +0200107FAQ
108---
Vincent Driessen61f2c692010-10-31 06:22:36 +0100109See the [FAQ](http://github.com/nvie/gitflow/wiki/FAQ) section of the project
110Wiki.
Vincent Driessencb922282010-09-22 20:38:55 +0200111
Vincent Driessen11965b32010-09-06 12:19:20 +0200112
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100113Please help out
114---------------
Vincent Driessenc49c7932010-02-24 01:22:48 +0100115This project is still under development. Feedback and suggestions are very
116welcome and I encourage you to use the [Issues
117list](http://github.com/nvie/gitflow/issues) on Github to provide that
Vincent Driessenf206ba62010-01-26 12:44:41 +0100118feedback.
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100119
Vincent Driessend79a0d42010-04-04 16:11:44 +0200120Feel free to fork this repo and to commit your additions. For a list of all
121contributors, please see the [AUTHORS](AUTHORS) file.
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100122
Vincent Driessen1fd5bcf2010-07-15 23:21:21 -0700123Any questions, tips, or general discussion can be posted to our Google group:
Vincent Driessen4d8b3792010-08-19 20:01:30 +0200124[http://groups.google.com/group/gitflow-users](http://groups.google.com/group/gitflow-users)
Vincent Driessen1fd5bcf2010-07-15 23:21:21 -0700125
Eric Holmes938ea5f2011-11-29 00:14:30 -0800126Contributing
127------------
Vincent Driessen49305ec2011-11-30 22:14:40 +0100128Fork the repository. Then, run:
129
130 git clone --recursive git@github.com:<username>/gitflow.git
131 cd gitflow
132 git branch master origin/master
133 git flow init -d
134 git flow feature start <your feature>
135
136Then, do work and commit your changes. **Hint**: ``export PATH=`pwd`:$PATH``
137from within the gitflow directory makes sure you're using the version of
138gitflow you're currently developing.
139
140 git flow feature publish <your feature>
141
142When done, open a pull request to your feature branch.
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100143
Vincent Driessen5d1dbe72010-04-04 15:52:55 +0200144License terms
145-------------
146git-flow is published under the liberal terms of the BSD License, see the
147[LICENSE](LICENSE) file. Although the BSD License does not require you to share
148any modifications you make to the source code, you are very much encouraged and
149invited to contribute back your modifications to the community, preferably
150in a Github fork, of course.
151
152
Vincent Driessenc49c7932010-02-24 01:22:48 +0100153### Initialization
154
155To initialize a new repo with the basic branch structure, use:
Vincent Driessen12c4ab42010-01-26 22:11:19 +0100156
Vincent Driessenc49c7932010-02-24 01:22:48 +0100157 git flow init
Vincent Driessenf9ebb072010-02-22 07:56:04 +0100158
Vincent Driessenc49c7932010-02-24 01:22:48 +0100159This will then interactively prompt you with some questions on which branches
160you would like to use as development and production branches, and how you
161would like your prefixes be named. You may simply press Return on any of
162those questions to accept the (sane) default suggestions.
163
164
165### Creating feature/release/hotfix/support branches
Vincent Driessen12c4ab42010-01-26 22:11:19 +0100166
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100167* To list/start/finish feature branches, use:
168
169 git flow feature
170 git flow feature start <name> [<base>]
171 git flow feature finish <name>
172
Vincent Driessen010252a2010-02-04 10:31:29 +0100173 For feature branches, the `<base>` arg must be a commit on `develop`.
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100174
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100175* To list/start/finish release branches, use:
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100176
Vincent Driessen04839ae2010-01-28 01:07:20 +0100177 git flow release
Vincent Driessen010252a2010-02-04 10:31:29 +0100178 git flow release start <release> [<base>]
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100179 git flow release finish <release>
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100180
Vincent Driessen010252a2010-02-04 10:31:29 +0100181 For release branches, the `<base>` arg must be a commit on `develop`.
182
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100183* To list/start/finish hotfix branches, use:
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100184
Vincent Driessen04839ae2010-01-28 01:07:20 +0100185 git flow hotfix
Vincent Driessen010252a2010-02-04 10:31:29 +0100186 git flow hotfix start <release> [<base>]
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100187 git flow hotfix finish <release>
Vincent Driessen010252a2010-02-04 10:31:29 +0100188
189 For hotfix branches, the `<base>` arg must be a commit on `master`.
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100190
191* To list/start support branches, use:
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100192
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100193 git flow support
Vincent Driessen010252a2010-02-04 10:31:29 +0100194 git flow support start <release> <base>
195
196 For support branches, the `<base>` arg must be a commit on `master`.
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100197
Vincent Driessenb33ea8a2010-08-24 13:58:32 +0200198
199Showing your appreciation
200=========================
201A few people already requested it, so now it's here: a Flattr button.
202
203Of course, the best way to show your appreciation for the original
204[blog post](http://nvie.com/git-model) or the git-flow tool itself remains
205contributing to the community. If you'd like to show your appreciation in
206another way, however, consider Flattr'ing me:
207
208[![Flattr this][2]][1]
209
210[1]: http://flattr.com/thing/53771/git-flow
211[2]: http://api.flattr.com/button/button-static-50x60.png