blob: 94d6c2589f73386b1a7c81c829d3bbf67072c982 [file] [log] [blame]
Vincent Driessen6c2d30b2010-01-26 22:18:36 +01001git-flow
2========
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 Driessen12c4ab42010-01-26 22:11:19 +01008Installing git-flow
9-------------------
Alexander Große26bfbc2010-11-02 14:05:44 +010010
11### Mac OS
12If you're on a Mac and use [homebrew](http://github.com/mxcl/homebrew), it's simple:
Vincent Driessen149d1542010-10-20 22:11:25 +020013
14 $ brew install git-flow
15
Alexander Große26bfbc2010-11-02 14:05:44 +010016If you're on a Mac and use [MacPorts](http://macports.org/), it's simple:
Vincent Driessen149d1542010-10-20 22:11:25 +020017
18 $ port install git-flow
19
Alexander Große26bfbc2010-11-02 14:05:44 +010020### Linux, etc.
Vincent Driessen149d1542010-10-20 22:11:25 +020021Another easy way to install git-flow is using Rick Osborne's excellent git-flow
22installer, which can be run using the following command:
Vincent Driessen4f0f5392010-07-10 17:05:27 +020023
Vincent Driessen6f199b92010-11-11 08:57:01 +010024 $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh
Vincent Driessen4f0f5392010-07-10 17:05:27 +020025
Alexander Große26bfbc2010-11-02 14:05:44 +010026### Windows
27#### Using Cygwin
28For Windows users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/)
29first to install tools like `git`, `util-linux` and `wget` (with those three being packages that can be selected
30during installation). Then simply run this command from a Cygwin shell:
JP Totoea738ef2010-08-20 04:56:57 +080031
Vincent Driessen6f199b92010-11-11 08:57:01 +010032 $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh
JP Totoea738ef2010-08-20 04:56:57 +080033
Alexander Große26bfbc2010-11-02 14:05:44 +010034#### Using msysgit
35This is much like the manual installation below, but there are additional steps required to install some extra tools that
36are not distributed with [msysgit](http://code.google.com/p/msysgit/).
37
38After cloning the git-flow sources from Github, also fetch the submodules:
39
40 $ git submodule init
41 $ git submodule update
42
43Copy git-flow's relevant files to your msysgit installation directory:
44
45 $ mkdir /usr/local/bin
46 $ cp git-flow* gitflow* /usr/local/bin/
47 $ cp shFlags/src/shflags /usr/local/bin/gitflow-shFlags
48
49Next up we need to borrow a couple of binaries from [Cygwin](http://www.cygwin.com/). If you don't have Cygwin installed, please
50install it including the `util-linux` package. Apart from `util-linux`'s dependencies, no other packages are required. When you
51finished installation, copy the following files using msysgit's _Git Bash_. We assume the Cygwin's default installation path in C:\cygwin.
52
53 $ cd /c/cygwin/
54 $ cp bin/getopt.exe /usr/local/bin/
55 $ cp bin/cyggcc_s-1.dll /usr/local/bin/
56 $ cp bin/cygiconv-2.dll /usr/local/bin/
57 $ cp bin/cygintl-8.dll /usr/local/bin/
58 $ cp bin/cygwin1.dll /usr/local/bin/
59
60After copying the files above, you can safely uninstall your Cygwin installation by deleting the C:\cygwin directory.
61
62### Manual installation
Vincent Driessen4f0f5392010-07-10 17:05:27 +020063If you prefer a manual installation, please use the following instructions.
Vincent Driessen13c94822010-02-15 20:09:02 +010064After downloading the sources from Github, also fetch the submodules:
65
66 $ git submodule init
67 $ git submodule update
68
69Then, you can install `git-flow`, using:
Vincent Driessenf206ba62010-01-26 12:44:41 +010070
Vincent Driessen12c4ab42010-01-26 22:11:19 +010071 $ sudo make install
Vincent Driessenf206ba62010-01-26 12:44:41 +010072
Vincent Driessene0b54c02010-03-19 19:27:38 +010073By default, git-flow will be installed in /usr/local. To change the prefix
74where git-flow will be installed, simply specify it explicitly, using:
Vincent Driessen12c4ab42010-01-26 22:11:19 +010075
Vincent Driessene0b54c02010-03-19 19:27:38 +010076 $ sudo make prefix=/opt/local install
Vincent Driessendd720be2010-01-27 00:00:09 +010077
78Or simply point your `PATH` environment variable to your git-flow checkout
79directory.
Vincent Driessenf206ba62010-01-26 12:44:41 +010080
Vincent Driessenb17b8982010-08-25 21:25:36 +020081*Installation note:*
82git-flow depends on the availability of the command line utility `getopt`,
83which may not be available in your Unix/Linux environment. Please use your
84favorite package manager to install `getopt`. For Cygwin, install the
Vincent Driessen47d1b9d2010-10-08 11:20:00 +020085`util-linux` package to get `getopt`. If you use `apt-get` as your install
86manager, the package name is `opt`.
Vincent Driessenb17b8982010-08-25 21:25:36 +020087
Vincent Driessenf206ba62010-01-26 12:44:41 +010088
Vincent Driessenec0b8542010-07-22 14:57:16 +020089Integration with your shell
90---------------------------
Vincent Driessen25def712010-08-25 21:25:57 +020091For those who use the [Bash](http://www.gnu.org/software/bash/) or
92[ZSH](http://www.zsh.org) shell, please check out the excellent work on the
Vincent Driessenec0b8542010-07-22 14:57:16 +020093[git-flow-completion](http://github.com/bobthecow/git-flow-completion) project
94by [bobthecow](http://github.com/bobthecow). It offers tab-completion for all
95git-flow subcommands and branch names.
96
Vincent Driessen25def712010-08-25 21:25:57 +020097For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good
98starting place for installing git.
JP Totoac949bf2010-08-20 05:01:52 +080099
Vincent Driessenec0b8542010-07-22 14:57:16 +0200100
Vincent Driessen11965b32010-09-06 12:19:20 +0200101FAQ
102---
Vincent Driessen61f2c692010-10-31 06:22:36 +0100103See the [FAQ](http://github.com/nvie/gitflow/wiki/FAQ) section of the project
104Wiki.
Vincent Driessencb922282010-09-22 20:38:55 +0200105
Vincent Driessen11965b32010-09-06 12:19:20 +0200106
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100107Please help out
108---------------
Vincent Driessenc49c7932010-02-24 01:22:48 +0100109This project is still under development. Feedback and suggestions are very
110welcome and I encourage you to use the [Issues
111list](http://github.com/nvie/gitflow/issues) on Github to provide that
Vincent Driessenf206ba62010-01-26 12:44:41 +0100112feedback.
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100113
Vincent Driessend79a0d42010-04-04 16:11:44 +0200114Feel free to fork this repo and to commit your additions. For a list of all
115contributors, please see the [AUTHORS](AUTHORS) file.
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100116
Vincent Driessen1fd5bcf2010-07-15 23:21:21 -0700117Any questions, tips, or general discussion can be posted to our Google group:
Vincent Driessen4d8b3792010-08-19 20:01:30 +0200118[http://groups.google.com/group/gitflow-users](http://groups.google.com/group/gitflow-users)
Vincent Driessen1fd5bcf2010-07-15 23:21:21 -0700119
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100120
Vincent Driessen5d1dbe72010-04-04 15:52:55 +0200121License terms
122-------------
123git-flow is published under the liberal terms of the BSD License, see the
124[LICENSE](LICENSE) file. Although the BSD License does not require you to share
125any modifications you make to the source code, you are very much encouraged and
126invited to contribute back your modifications to the community, preferably
127in a Github fork, of course.
128
129
Vincent Driessenc49c7932010-02-24 01:22:48 +0100130Typical usage:
131--------------
Vincent Driessenb731e6f2010-08-19 20:00:02 +0200132For the best introduction to get started to `git flow`, please read Jeff
133Kreeftmeijer's blog post:
134
Vincent Driessen4d8b3792010-08-19 20:01:30 +0200135[http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/)
Vincent Driessenb731e6f2010-08-19 20:00:02 +0200136
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100137
Vincent Driessenc49c7932010-02-24 01:22:48 +0100138### Initialization
139
140To initialize a new repo with the basic branch structure, use:
Vincent Driessen12c4ab42010-01-26 22:11:19 +0100141
Vincent Driessenc49c7932010-02-24 01:22:48 +0100142 git flow init
Vincent Driessenf9ebb072010-02-22 07:56:04 +0100143
Vincent Driessenc49c7932010-02-24 01:22:48 +0100144This will then interactively prompt you with some questions on which branches
145you would like to use as development and production branches, and how you
146would like your prefixes be named. You may simply press Return on any of
147those questions to accept the (sane) default suggestions.
148
149
150### Creating feature/release/hotfix/support branches
Vincent Driessen12c4ab42010-01-26 22:11:19 +0100151
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100152* To list/start/finish feature branches, use:
153
154 git flow feature
155 git flow feature start <name> [<base>]
156 git flow feature finish <name>
157
Vincent Driessen010252a2010-02-04 10:31:29 +0100158 For feature branches, the `<base>` arg must be a commit on `develop`.
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100159
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100160* To list/start/finish release branches, use:
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100161
Vincent Driessen04839ae2010-01-28 01:07:20 +0100162 git flow release
Vincent Driessen010252a2010-02-04 10:31:29 +0100163 git flow release start <release> [<base>]
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100164 git flow release finish <release>
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100165
Vincent Driessen010252a2010-02-04 10:31:29 +0100166 For release branches, the `<base>` arg must be a commit on `develop`.
167
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100168* To list/start/finish hotfix branches, use:
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100169
Vincent Driessen04839ae2010-01-28 01:07:20 +0100170 git flow hotfix
Vincent Driessen010252a2010-02-04 10:31:29 +0100171 git flow hotfix start <release> [<base>]
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100172 git flow hotfix finish <release>
Vincent Driessen010252a2010-02-04 10:31:29 +0100173
174 For hotfix branches, the `<base>` arg must be a commit on `master`.
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100175
176* To list/start support branches, use:
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100177
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100178 git flow support
Vincent Driessen010252a2010-02-04 10:31:29 +0100179 git flow support start <release> <base>
180
181 For support branches, the `<base>` arg must be a commit on `master`.
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100182
Vincent Driessenb33ea8a2010-08-24 13:58:32 +0200183
184Showing your appreciation
185=========================
186A few people already requested it, so now it's here: a Flattr button.
187
188Of course, the best way to show your appreciation for the original
189[blog post](http://nvie.com/git-model) or the git-flow tool itself remains
190contributing to the community. If you'd like to show your appreciation in
191another way, however, consider Flattr'ing me:
192
193[![Flattr this][2]][1]
194
195[1]: http://flattr.com/thing/53771/git-flow
196[2]: http://api.flattr.com/button/button-static-50x60.png