blob: aeb50fb710adb0bfcd5837e9befb6a441d5b6b1a [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-------------------
Vincent Driessen4f0f5392010-07-10 17:05:27 +020010The easiest way to install git-flow is using Rick Osborne's excellent
11git-flow installer, which can be run using the following command:
12
13 $ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh
14
eddie ciancic2130522010-09-05 01:19:35 +080015For __OSX__ users, the `wget` command isn't available by default, but `curl` is, so you can run:
16
17 $ curl http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh
18
19For __Windows__ users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/)
JP Totoea738ef2010-08-20 04:56:57 +080020first to install tools like sh and wget. Then simply follow the command:
21
22 c:\Users\<user> wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh
23
Vincent Driessen4f0f5392010-07-10 17:05:27 +020024If you prefer a manual installation, please use the following instructions.
Vincent Driessen13c94822010-02-15 20:09:02 +010025After downloading the sources from Github, also fetch the submodules:
26
27 $ git submodule init
28 $ git submodule update
29
30Then, you can install `git-flow`, using:
Vincent Driessenf206ba62010-01-26 12:44:41 +010031
Vincent Driessen12c4ab42010-01-26 22:11:19 +010032 $ sudo make install
Vincent Driessenf206ba62010-01-26 12:44:41 +010033
Vincent Driessene0b54c02010-03-19 19:27:38 +010034By default, git-flow will be installed in /usr/local. To change the prefix
35where git-flow will be installed, simply specify it explicitly, using:
Vincent Driessen12c4ab42010-01-26 22:11:19 +010036
Vincent Driessene0b54c02010-03-19 19:27:38 +010037 $ sudo make prefix=/opt/local install
Vincent Driessendd720be2010-01-27 00:00:09 +010038
39Or simply point your `PATH` environment variable to your git-flow checkout
40directory.
Vincent Driessenf206ba62010-01-26 12:44:41 +010041
Vincent Driessenb17b8982010-08-25 21:25:36 +020042*Installation note:*
43git-flow depends on the availability of the command line utility `getopt`,
44which may not be available in your Unix/Linux environment. Please use your
45favorite package manager to install `getopt`. For Cygwin, install the
46`util-linux` package to get `getopt`.
47
Vincent Driessenf206ba62010-01-26 12:44:41 +010048
Vincent Driessenec0b8542010-07-22 14:57:16 +020049Integration with your shell
50---------------------------
Vincent Driessen25def712010-08-25 21:25:57 +020051For those who use the [Bash](http://www.gnu.org/software/bash/) or
52[ZSH](http://www.zsh.org) shell, please check out the excellent work on the
Vincent Driessenec0b8542010-07-22 14:57:16 +020053[git-flow-completion](http://github.com/bobthecow/git-flow-completion) project
54by [bobthecow](http://github.com/bobthecow). It offers tab-completion for all
55git-flow subcommands and branch names.
56
Vincent Driessen25def712010-08-25 21:25:57 +020057For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good
58starting place for installing git.
JP Totoac949bf2010-08-20 05:01:52 +080059
Vincent Driessenec0b8542010-07-22 14:57:16 +020060
Vincent Driessen11965b32010-09-06 12:19:20 +020061FAQ
62---
63* **Can I still do manual branches and merges when I use git-flow?**
Vincent Driessen0c927772010-09-06 12:22:10 +020064 Of course you can. `git-flow` does not forbid you to keep using vanilla Git
Vincent Driessen11965b32010-09-06 12:19:20 +020065 commands!
66
67 So if you want to merge `master` into `develop` for whatever reason you want
68 to, you can safely do so without breaking `git-flow` compatibility. Do you
69 want to manually merge a feature branch X into another feature branch Y? Not
70 a problem. As long as you do it conciously and realize what this means for
71 finishing those branches later on.
72
Vincent Driessenf8b34b22010-09-06 12:37:04 +020073* **Why does git-describe not work for me?**
74 When finishing release and hotfix branches, that branch's HEAD is first
75 merged into `master` and then into `develop`. It is not the resulting new
76 merge commit from `master` that is merged back into `develop`. This means
77 that a linear path from the new `develop` branch to the new `master` commit
78 is not created. Even worse, a linear path is created from the new `develop`
79 branch to the *previous* `master` commit. Although unintended, this is
80 simply an effect of using the current branching rules.
81
82 When using `git-describe` in these cases, you can get very confusing and
83 misleading results, since `git-describe` scans the current commits linear
84 history for the most recent tag it finds, which will always be the *previous*
85 tag.
86
87 I will change this behaviour in the next version of the branching model
88 explicitly and I will include this behavioural change in the first version of
89 the Python rewrite.
90
91 For more references to this problem, see:
92
93 - Issue [#49](http://github.com/nvie/gitflow/issues/49)
94 - These
95 [two](http://groups.google.com/group/gitflow-users/browse\_thread/thread/9920a7df3d1c4908/0bb18a0bf7275ad6#0bb18a0bf7275ad6)
96 [discussions](http://groups.google.com/group/gitflow-users/browse\_thread/thread/19efac724bb6418a)
97 on the [git-flow-users](http://groups.google.com/group/gitflow-users)
98 mailinglist.
99
Vincent Driessen11965b32010-09-06 12:19:20 +0200100* **I'm getting errors when I use flags with git-flow!**
Vincent Driessen0c927772010-09-06 12:22:10 +0200101 `git-flow` uses the [shFlags](http://code.google.com/p/shflags/) library to
Vincent Driessen11965b32010-09-06 12:19:20 +0200102 provide platform independent flag parsing (using wichever low-level flag
103 parsing libraries like `getopt` or `getopts` are available). However,
104 `shFlags` does not work too well on a few platforms that haven't been tested
105 originally. This results in errors like this:
106
107 flags:WARN getopt: option invalide -- 'f' -- 'init' flags:FATAL unable to parse provided options with getopt
108
109 The platforms that suffer these errors include:
110
111 - Gentoo
112 - Ubuntu
113 - Redhat Enterprise Linux
114
Vincent Driessenf74a3a72010-09-06 12:21:23 +0200115 There are open issues related to this:
116 [#28](http://github.com/nvie/gitflow/issues/28) and
117 [#39](http://github.com/nvie/gitflow/issues/39). Unfortunately, there is no
118 simple fix for it and all hope is placed on the Python rewrite of `git-flow`,
119 see issue [#33](http://github.com/nvie/gitflow/issues/33).
Vincent Driessen11965b32010-09-06 12:19:20 +0200120
Vincent Driessencb922282010-09-22 20:38:55 +0200121* **Can I use it with Windows?**
122 There have been reports of Windows users using `git-flow`.
123 <del>Un</del>fortunately, I have no Windows environment to test it on, but
124 this [issue](http://github.com/nvie/gitflow/issues/issue/25) should be
125 helpful in setting it up.
126
Vincent Driessen11965b32010-09-06 12:19:20 +0200127
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100128Please help out
129---------------
Vincent Driessenc49c7932010-02-24 01:22:48 +0100130This project is still under development. Feedback and suggestions are very
131welcome and I encourage you to use the [Issues
132list](http://github.com/nvie/gitflow/issues) on Github to provide that
Vincent Driessenf206ba62010-01-26 12:44:41 +0100133feedback.
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100134
Vincent Driessend79a0d42010-04-04 16:11:44 +0200135Feel free to fork this repo and to commit your additions. For a list of all
136contributors, please see the [AUTHORS](AUTHORS) file.
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100137
Vincent Driessen1fd5bcf2010-07-15 23:21:21 -0700138Any questions, tips, or general discussion can be posted to our Google group:
Vincent Driessen4d8b3792010-08-19 20:01:30 +0200139[http://groups.google.com/group/gitflow-users](http://groups.google.com/group/gitflow-users)
Vincent Driessen1fd5bcf2010-07-15 23:21:21 -0700140
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100141
Vincent Driessen5d1dbe72010-04-04 15:52:55 +0200142License terms
143-------------
144git-flow is published under the liberal terms of the BSD License, see the
145[LICENSE](LICENSE) file. Although the BSD License does not require you to share
146any modifications you make to the source code, you are very much encouraged and
147invited to contribute back your modifications to the community, preferably
148in a Github fork, of course.
149
150
Vincent Driessenc49c7932010-02-24 01:22:48 +0100151Typical usage:
152--------------
Vincent Driessenb731e6f2010-08-19 20:00:02 +0200153For the best introduction to get started to `git flow`, please read Jeff
154Kreeftmeijer's blog post:
155
Vincent Driessen4d8b3792010-08-19 20:01:30 +0200156[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 +0200157
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100158
Vincent Driessenc49c7932010-02-24 01:22:48 +0100159### Initialization
160
161To initialize a new repo with the basic branch structure, use:
Vincent Driessen12c4ab42010-01-26 22:11:19 +0100162
Vincent Driessenc49c7932010-02-24 01:22:48 +0100163 git flow init
Vincent Driessenf9ebb072010-02-22 07:56:04 +0100164
Vincent Driessenc49c7932010-02-24 01:22:48 +0100165This will then interactively prompt you with some questions on which branches
166you would like to use as development and production branches, and how you
167would like your prefixes be named. You may simply press Return on any of
168those questions to accept the (sane) default suggestions.
169
170
171### Creating feature/release/hotfix/support branches
Vincent Driessen12c4ab42010-01-26 22:11:19 +0100172
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100173* To list/start/finish feature branches, use:
174
175 git flow feature
176 git flow feature start <name> [<base>]
177 git flow feature finish <name>
178
Vincent Driessen010252a2010-02-04 10:31:29 +0100179 For feature branches, the `<base>` arg must be a commit on `develop`.
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100180
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100181* To list/start/finish release branches, use:
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100182
Vincent Driessen04839ae2010-01-28 01:07:20 +0100183 git flow release
Vincent Driessen010252a2010-02-04 10:31:29 +0100184 git flow release start <release> [<base>]
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100185 git flow release finish <release>
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100186
Vincent Driessen010252a2010-02-04 10:31:29 +0100187 For release branches, the `<base>` arg must be a commit on `develop`.
188
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100189* To list/start/finish hotfix branches, use:
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100190
Vincent Driessen04839ae2010-01-28 01:07:20 +0100191 git flow hotfix
Vincent Driessen010252a2010-02-04 10:31:29 +0100192 git flow hotfix start <release> [<base>]
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100193 git flow hotfix finish <release>
Vincent Driessen010252a2010-02-04 10:31:29 +0100194
195 For hotfix branches, the `<base>` arg must be a commit on `master`.
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100196
197* To list/start support branches, use:
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100198
Vincent Driessenc81e7a22010-01-28 00:33:24 +0100199 git flow support
Vincent Driessen010252a2010-02-04 10:31:29 +0100200 git flow support start <release> <base>
201
202 For support branches, the `<base>` arg must be a commit on `master`.
Vincent Driessen78c73dc2010-01-21 00:48:44 +0100203
Vincent Driessenb33ea8a2010-08-24 13:58:32 +0200204
205Showing your appreciation
206=========================
207A few people already requested it, so now it's here: a Flattr button.
208
209Of course, the best way to show your appreciation for the original
210[blog post](http://nvie.com/git-model) or the git-flow tool itself remains
211contributing to the community. If you'd like to show your appreciation in
212another way, however, consider Flattr'ing me:
213
214[![Flattr this][2]][1]
215
216[1]: http://flattr.com/thing/53771/git-flow
217[2]: http://api.flattr.com/button/button-static-50x60.png