| Vincent Driessen | 6c2d30b | 2010-01-26 22:18:36 +0100 | [diff] [blame] | 1 | git-flow | 
|  | 2 | ======== | 
| Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 3 | A collection of Git extensions to provide high-level repository operations | 
| Vincent Driessen | 4fc0bc1 | 2010-02-24 01:43:04 +0100 | [diff] [blame] | 4 | for Vincent Driessen's [branching model](http://nvie.com/git-model "original | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 5 | blog post"). | 
|  | 6 |  | 
| Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 7 |  | 
| Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 8 | Installing git-flow | 
|  | 9 | ------------------- | 
| Vincent Driessen | 4f0f539 | 2010-07-10 17:05:27 +0200 | [diff] [blame] | 10 | The easiest way to install git-flow is using Rick Osborne's excellent | 
|  | 11 | git-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 cianci | c213052 | 2010-09-05 01:19:35 +0800 | [diff] [blame] | 15 | For __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 |  | 
|  | 19 | For __Windows__ users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/) | 
| JP Toto | ea738ef | 2010-08-20 04:56:57 +0800 | [diff] [blame] | 20 | first 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 Driessen | 4f0f539 | 2010-07-10 17:05:27 +0200 | [diff] [blame] | 24 | If you prefer a manual installation, please use the following instructions. | 
| Vincent Driessen | 13c9482 | 2010-02-15 20:09:02 +0100 | [diff] [blame] | 25 | After downloading the sources from Github, also fetch the submodules: | 
|  | 26 |  | 
|  | 27 | $ git submodule init | 
|  | 28 | $ git submodule update | 
|  | 29 |  | 
|  | 30 | Then, you can install `git-flow`, using: | 
| Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 31 |  | 
| Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 32 | $ sudo make install | 
| Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 33 |  | 
| Vincent Driessen | e0b54c0 | 2010-03-19 19:27:38 +0100 | [diff] [blame] | 34 | By default, git-flow will be installed in /usr/local. To change the prefix | 
|  | 35 | where git-flow will be installed, simply specify it explicitly, using: | 
| Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 36 |  | 
| Vincent Driessen | e0b54c0 | 2010-03-19 19:27:38 +0100 | [diff] [blame] | 37 | $ sudo make prefix=/opt/local install | 
| Vincent Driessen | dd720be | 2010-01-27 00:00:09 +0100 | [diff] [blame] | 38 |  | 
|  | 39 | Or simply point your `PATH` environment variable to your git-flow checkout | 
|  | 40 | directory. | 
| Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 41 |  | 
| Vincent Driessen | b17b898 | 2010-08-25 21:25:36 +0200 | [diff] [blame] | 42 | *Installation note:* | 
|  | 43 | git-flow depends on the availability of the command line utility `getopt`, | 
|  | 44 | which may not be available in your Unix/Linux environment.  Please use your | 
|  | 45 | favorite package manager to install `getopt`.  For Cygwin, install the | 
| Vincent Driessen | 47d1b9d | 2010-10-08 11:20:00 +0200 | [diff] [blame] | 46 | `util-linux` package to get `getopt`.  If you use `apt-get` as your install | 
|  | 47 | manager, the package name is `opt`. | 
| Vincent Driessen | b17b898 | 2010-08-25 21:25:36 +0200 | [diff] [blame] | 48 |  | 
| Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 49 |  | 
| Vincent Driessen | ec0b854 | 2010-07-22 14:57:16 +0200 | [diff] [blame] | 50 | Integration with your shell | 
|  | 51 | --------------------------- | 
| Vincent Driessen | 25def71 | 2010-08-25 21:25:57 +0200 | [diff] [blame] | 52 | For those who use the [Bash](http://www.gnu.org/software/bash/) or | 
|  | 53 | [ZSH](http://www.zsh.org) shell, please check out the excellent work on the | 
| Vincent Driessen | ec0b854 | 2010-07-22 14:57:16 +0200 | [diff] [blame] | 54 | [git-flow-completion](http://github.com/bobthecow/git-flow-completion) project | 
|  | 55 | by [bobthecow](http://github.com/bobthecow). It offers tab-completion for all | 
|  | 56 | git-flow subcommands and branch names. | 
|  | 57 |  | 
| Vincent Driessen | 25def71 | 2010-08-25 21:25:57 +0200 | [diff] [blame] | 58 | For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good | 
|  | 59 | starting place for installing git. | 
| JP Toto | ac949bf | 2010-08-20 05:01:52 +0800 | [diff] [blame] | 60 |  | 
| Vincent Driessen | ec0b854 | 2010-07-22 14:57:16 +0200 | [diff] [blame] | 61 |  | 
| Vincent Driessen | 11965b3 | 2010-09-06 12:19:20 +0200 | [diff] [blame] | 62 | FAQ | 
|  | 63 | --- | 
|  | 64 | * **Can I still do manual branches and merges when I use git-flow?** | 
| Vincent Driessen | 0c92777 | 2010-09-06 12:22:10 +0200 | [diff] [blame] | 65 | Of course you can. `git-flow` does not forbid you to keep using vanilla Git | 
| Vincent Driessen | 11965b3 | 2010-09-06 12:19:20 +0200 | [diff] [blame] | 66 | commands! | 
|  | 67 |  | 
|  | 68 | So if you want to merge `master` into `develop` for whatever reason you want | 
|  | 69 | to, you can safely do so without breaking `git-flow` compatibility.  Do you | 
|  | 70 | want to manually merge a feature branch X into another feature branch Y?  Not | 
|  | 71 | a problem.  As long as you do it conciously and realize what this means for | 
|  | 72 | finishing those branches later on. | 
|  | 73 |  | 
| Vincent Driessen | f8b34b2 | 2010-09-06 12:37:04 +0200 | [diff] [blame] | 74 | * **Why does git-describe not work for me?** | 
|  | 75 | When finishing release and hotfix branches, that branch's HEAD is first | 
|  | 76 | merged into `master` and then into `develop`.  It is not the resulting new | 
|  | 77 | merge commit from `master` that is merged back into `develop`.  This means | 
|  | 78 | that a linear path from the new `develop` branch to the new `master` commit | 
|  | 79 | is not created.  Even worse, a linear path is created from the new `develop` | 
|  | 80 | branch to the *previous* `master` commit.  Although unintended, this is | 
|  | 81 | simply an effect of using the current branching rules. | 
|  | 82 |  | 
|  | 83 | When using `git-describe` in these cases, you can get very confusing and | 
|  | 84 | misleading results, since `git-describe` scans the current commits linear | 
|  | 85 | history for the most recent tag it finds, which will always be the *previous* | 
|  | 86 | tag. | 
|  | 87 |  | 
|  | 88 | I will change this behaviour in the next version of the branching model | 
|  | 89 | explicitly and I will include this behavioural change in the first version of | 
|  | 90 | the Python rewrite. | 
|  | 91 |  | 
|  | 92 | For more references to this problem, see: | 
|  | 93 |  | 
|  | 94 | - Issue [#49](http://github.com/nvie/gitflow/issues/49) | 
|  | 95 | - These | 
|  | 96 | [two](http://groups.google.com/group/gitflow-users/browse\_thread/thread/9920a7df3d1c4908/0bb18a0bf7275ad6#0bb18a0bf7275ad6) | 
|  | 97 | [discussions](http://groups.google.com/group/gitflow-users/browse\_thread/thread/19efac724bb6418a) | 
|  | 98 | on the [git-flow-users](http://groups.google.com/group/gitflow-users) | 
|  | 99 | mailinglist. | 
|  | 100 |  | 
| Vincent Driessen | cb92228 | 2010-09-22 20:38:55 +0200 | [diff] [blame] | 101 | * **Can I use it with Windows?** | 
|  | 102 | There have been reports of Windows users using `git-flow`. | 
|  | 103 | <del>Un</del>fortunately, I have no Windows environment to test it on, but | 
|  | 104 | this [issue](http://github.com/nvie/gitflow/issues/issue/25) should be | 
|  | 105 | helpful in setting it up. | 
|  | 106 |  | 
| Vincent Driessen | 11965b3 | 2010-09-06 12:19:20 +0200 | [diff] [blame] | 107 |  | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 108 | Please help out | 
|  | 109 | --------------- | 
| Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 110 | This project is still under development. Feedback and suggestions are very | 
|  | 111 | welcome and I encourage you to use the [Issues | 
|  | 112 | list](http://github.com/nvie/gitflow/issues) on Github to provide that | 
| Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 113 | feedback. | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 114 |  | 
| Vincent Driessen | d79a0d4 | 2010-04-04 16:11:44 +0200 | [diff] [blame] | 115 | Feel free to fork this repo and to commit your additions. For a list of all | 
|  | 116 | contributors, please see the [AUTHORS](AUTHORS) file. | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 117 |  | 
| Vincent Driessen | 1fd5bcf | 2010-07-15 23:21:21 -0700 | [diff] [blame] | 118 | Any questions, tips, or general discussion can be posted to our Google group: | 
| Vincent Driessen | 4d8b379 | 2010-08-19 20:01:30 +0200 | [diff] [blame] | 119 | [http://groups.google.com/group/gitflow-users](http://groups.google.com/group/gitflow-users) | 
| Vincent Driessen | 1fd5bcf | 2010-07-15 23:21:21 -0700 | [diff] [blame] | 120 |  | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 121 |  | 
| Vincent Driessen | 5d1dbe7 | 2010-04-04 15:52:55 +0200 | [diff] [blame] | 122 | License terms | 
|  | 123 | ------------- | 
|  | 124 | git-flow is published under the liberal terms of the BSD License, see the | 
|  | 125 | [LICENSE](LICENSE) file. Although the BSD License does not require you to share | 
|  | 126 | any modifications you make to the source code, you are very much encouraged and | 
|  | 127 | invited to contribute back your modifications to the community, preferably | 
|  | 128 | in a Github fork, of course. | 
|  | 129 |  | 
|  | 130 |  | 
| Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 131 | Typical usage: | 
|  | 132 | -------------- | 
| Vincent Driessen | b731e6f | 2010-08-19 20:00:02 +0200 | [diff] [blame] | 133 | For the best introduction to get started to `git flow`, please read Jeff | 
|  | 134 | Kreeftmeijer's blog post: | 
|  | 135 |  | 
| Vincent Driessen | 4d8b379 | 2010-08-19 20:01:30 +0200 | [diff] [blame] | 136 | [http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/) | 
| Vincent Driessen | b731e6f | 2010-08-19 20:00:02 +0200 | [diff] [blame] | 137 |  | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 138 |  | 
| Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 139 | ### Initialization | 
|  | 140 |  | 
|  | 141 | To initialize a new repo with the basic branch structure, use: | 
| Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 142 |  | 
| Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 143 | git flow init | 
| Vincent Driessen | f9ebb07 | 2010-02-22 07:56:04 +0100 | [diff] [blame] | 144 |  | 
| Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 145 | This will then interactively prompt you with some questions on which branches | 
|  | 146 | you would like to use as development and production branches, and how you | 
|  | 147 | would like your prefixes be named. You may simply press Return on any of | 
|  | 148 | those questions to accept the (sane) default suggestions. | 
|  | 149 |  | 
|  | 150 |  | 
|  | 151 | ### Creating feature/release/hotfix/support branches | 
| Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 152 |  | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 153 | * To list/start/finish feature branches, use: | 
|  | 154 |  | 
|  | 155 | git flow feature | 
|  | 156 | git flow feature start <name> [<base>] | 
|  | 157 | git flow feature finish <name> | 
|  | 158 |  | 
| Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 159 | For feature branches, the `<base>` arg must be a commit on `develop`. | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 160 |  | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 161 | * To list/start/finish release branches, use: | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 162 |  | 
| Vincent Driessen | 04839ae | 2010-01-28 01:07:20 +0100 | [diff] [blame] | 163 | git flow release | 
| Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 164 | git flow release start <release> [<base>] | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 165 | git flow release finish <release> | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 166 |  | 
| Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 167 | For release branches, the `<base>` arg must be a commit on `develop`. | 
|  | 168 |  | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 169 | * To list/start/finish hotfix branches, use: | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 170 |  | 
| Vincent Driessen | 04839ae | 2010-01-28 01:07:20 +0100 | [diff] [blame] | 171 | git flow hotfix | 
| Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 172 | git flow hotfix start <release> [<base>] | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 173 | git flow hotfix finish <release> | 
| Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 174 |  | 
|  | 175 | For hotfix branches, the `<base>` arg must be a commit on `master`. | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 176 |  | 
|  | 177 | * To list/start support branches, use: | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 178 |  | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 179 | git flow support | 
| Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 180 | git flow support start <release> <base> | 
|  | 181 |  | 
|  | 182 | For support branches, the `<base>` arg must be a commit on `master`. | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 183 |  | 
| Vincent Driessen | b33ea8a | 2010-08-24 13:58:32 +0200 | [diff] [blame] | 184 |  | 
|  | 185 | Showing your appreciation | 
|  | 186 | ========================= | 
|  | 187 | A few people already requested it, so now it's here: a Flattr button. | 
|  | 188 |  | 
|  | 189 | Of course, the best way to show your appreciation for the original | 
|  | 190 | [blog post](http://nvie.com/git-model) or the git-flow tool itself remains | 
|  | 191 | contributing to the community.  If you'd like to show your appreciation in | 
|  | 192 | another way, however, consider Flattr'ing me: | 
|  | 193 |  | 
|  | 194 | [![Flattr this][2]][1] | 
|  | 195 |  | 
|  | 196 | [1]: http://flattr.com/thing/53771/git-flow | 
|  | 197 | [2]: http://api.flattr.com/button/button-static-50x60.png |