| Vincent Driessen | 877f5fe | 2010-12-06 14:54:50 -0800 | [diff] [blame] | 1 | git-flow  | 
| Vincent Driessen | 6c2d30b | 2010-01-26 22:18:36 +0100 | [diff] [blame] | 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 | ------------------- | 
| Alexander Groß | e26bfbc | 2010-11-02 14:05:44 +0100 | [diff] [blame] | 10 |  | 
|  | 11 | ### Mac OS | 
|  | 12 | If you're on a Mac and use [homebrew](http://github.com/mxcl/homebrew), it's simple: | 
| Vincent Driessen | 149d154 | 2010-10-20 22:11:25 +0200 | [diff] [blame] | 13 |  | 
|  | 14 | $ brew install git-flow | 
|  | 15 |  | 
| Alexander Groß | e26bfbc | 2010-11-02 14:05:44 +0100 | [diff] [blame] | 16 | If you're on a Mac and use [MacPorts](http://macports.org/), it's simple: | 
| Vincent Driessen | 149d154 | 2010-10-20 22:11:25 +0200 | [diff] [blame] | 17 |  | 
|  | 18 | $ port install git-flow | 
|  | 19 |  | 
| Alexander Groß | e26bfbc | 2010-11-02 14:05:44 +0100 | [diff] [blame] | 20 | ### Linux, etc. | 
| Vincent Driessen | 149d154 | 2010-10-20 22:11:25 +0200 | [diff] [blame] | 21 | Another easy way to install git-flow is using Rick Osborne's excellent git-flow | 
|  | 22 | installer, which can be run using the following command: | 
| Vincent Driessen | 4f0f539 | 2010-07-10 17:05:27 +0200 | [diff] [blame] | 23 |  | 
| Vincent Driessen | 6f199b9 | 2010-11-11 08:57:01 +0100 | [diff] [blame] | 24 | $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh | 
| Vincent Driessen | 4f0f539 | 2010-07-10 17:05:27 +0200 | [diff] [blame] | 25 |  | 
| Alexander Groß | e26bfbc | 2010-11-02 14:05:44 +0100 | [diff] [blame] | 26 | ### Windows | 
|  | 27 | #### Using Cygwin | 
|  | 28 | For Windows users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/) | 
|  | 29 | first to install tools like `git`, `util-linux` and `wget` (with those three being packages that can be selected | 
|  | 30 | during installation). Then simply run this command from a Cygwin shell: | 
| JP Toto | ea738ef | 2010-08-20 04:56:57 +0800 | [diff] [blame] | 31 |  | 
| Vincent Driessen | 6f199b9 | 2010-11-11 08:57:01 +0100 | [diff] [blame] | 32 | $ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh | 
| JP Toto | ea738ef | 2010-08-20 04:56:57 +0800 | [diff] [blame] | 33 |  | 
| Alexander Groß | e26bfbc | 2010-11-02 14:05:44 +0100 | [diff] [blame] | 34 | #### Using msysgit | 
|  | 35 | This is much like the manual installation below, but there are additional steps required to install some extra tools that | 
|  | 36 | are not distributed with [msysgit](http://code.google.com/p/msysgit/). | 
|  | 37 |  | 
|  | 38 | After cloning the git-flow sources from Github, also fetch the submodules: | 
|  | 39 |  | 
|  | 40 | $ git submodule init | 
|  | 41 | $ git submodule update | 
|  | 42 |  | 
|  | 43 | Copy 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 |  | 
|  | 49 | Next up we need to borrow a couple of binaries from [Cygwin](http://www.cygwin.com/). If you don't have Cygwin installed, please | 
|  | 50 | install it including the `util-linux` package. Apart from `util-linux`'s dependencies, no other packages are required. When you | 
|  | 51 | finished 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 |  | 
|  | 60 | After copying the files above, you can safely uninstall your Cygwin installation by deleting the C:\cygwin directory. | 
|  | 61 |  | 
|  | 62 | ### Manual installation | 
| Vincent Driessen | 4f0f539 | 2010-07-10 17:05:27 +0200 | [diff] [blame] | 63 | If you prefer a manual installation, please use the following instructions. | 
| Vincent Driessen | 13c9482 | 2010-02-15 20:09:02 +0100 | [diff] [blame] | 64 | After downloading the sources from Github, also fetch the submodules: | 
|  | 65 |  | 
|  | 66 | $ git submodule init | 
|  | 67 | $ git submodule update | 
|  | 68 |  | 
|  | 69 | Then, you can install `git-flow`, using: | 
| Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 70 |  | 
| Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 71 | $ sudo make install | 
| Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 72 |  | 
| Vincent Driessen | e0b54c0 | 2010-03-19 19:27:38 +0100 | [diff] [blame] | 73 | By default, git-flow will be installed in /usr/local. To change the prefix | 
|  | 74 | where git-flow will be installed, simply specify it explicitly, using: | 
| Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 75 |  | 
| Vincent Driessen | e0b54c0 | 2010-03-19 19:27:38 +0100 | [diff] [blame] | 76 | $ sudo make prefix=/opt/local install | 
| Vincent Driessen | dd720be | 2010-01-27 00:00:09 +0100 | [diff] [blame] | 77 |  | 
|  | 78 | Or simply point your `PATH` environment variable to your git-flow checkout | 
|  | 79 | directory. | 
| Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 80 |  | 
| Vincent Driessen | b17b898 | 2010-08-25 21:25:36 +0200 | [diff] [blame] | 81 | *Installation note:* | 
|  | 82 | git-flow depends on the availability of the command line utility `getopt`, | 
|  | 83 | which may not be available in your Unix/Linux environment.  Please use your | 
|  | 84 | favorite package manager to install `getopt`.  For Cygwin, install the | 
| Vincent Driessen | 47d1b9d | 2010-10-08 11:20:00 +0200 | [diff] [blame] | 85 | `util-linux` package to get `getopt`.  If you use `apt-get` as your install | 
|  | 86 | manager, the package name is `opt`. | 
| Vincent Driessen | b17b898 | 2010-08-25 21:25:36 +0200 | [diff] [blame] | 87 |  | 
| Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 88 |  | 
| Vincent Driessen | ec0b854 | 2010-07-22 14:57:16 +0200 | [diff] [blame] | 89 | Integration with your shell | 
|  | 90 | --------------------------- | 
| Vincent Driessen | 25def71 | 2010-08-25 21:25:57 +0200 | [diff] [blame] | 91 | For 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 Driessen | ec0b854 | 2010-07-22 14:57:16 +0200 | [diff] [blame] | 93 | [git-flow-completion](http://github.com/bobthecow/git-flow-completion) project | 
|  | 94 | by [bobthecow](http://github.com/bobthecow). It offers tab-completion for all | 
|  | 95 | git-flow subcommands and branch names. | 
|  | 96 |  | 
| Vincent Driessen | 25def71 | 2010-08-25 21:25:57 +0200 | [diff] [blame] | 97 | For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good | 
|  | 98 | starting place for installing git. | 
| JP Toto | ac949bf | 2010-08-20 05:01:52 +0800 | [diff] [blame] | 99 |  | 
| Vincent Driessen | ec0b854 | 2010-07-22 14:57:16 +0200 | [diff] [blame] | 100 |  | 
| Vincent Driessen | 11965b3 | 2010-09-06 12:19:20 +0200 | [diff] [blame] | 101 | FAQ | 
|  | 102 | --- | 
| Vincent Driessen | 61f2c69 | 2010-10-31 06:22:36 +0100 | [diff] [blame] | 103 | See the [FAQ](http://github.com/nvie/gitflow/wiki/FAQ) section of the project | 
|  | 104 | Wiki. | 
| Vincent Driessen | cb92228 | 2010-09-22 20:38:55 +0200 | [diff] [blame] | 105 |  | 
| Vincent Driessen | 11965b3 | 2010-09-06 12:19:20 +0200 | [diff] [blame] | 106 |  | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 107 | Please help out | 
|  | 108 | --------------- | 
| Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 109 | This project is still under development. Feedback and suggestions are very | 
|  | 110 | welcome and I encourage you to use the [Issues | 
|  | 111 | list](http://github.com/nvie/gitflow/issues) on Github to provide that | 
| Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 112 | feedback. | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 113 |  | 
| Vincent Driessen | d79a0d4 | 2010-04-04 16:11:44 +0200 | [diff] [blame] | 114 | Feel free to fork this repo and to commit your additions. For a list of all | 
|  | 115 | contributors, please see the [AUTHORS](AUTHORS) file. | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 116 |  | 
| Vincent Driessen | 1fd5bcf | 2010-07-15 23:21:21 -0700 | [diff] [blame] | 117 | 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] | 118 | [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] | 119 |  | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 120 |  | 
| Vincent Driessen | 5d1dbe7 | 2010-04-04 15:52:55 +0200 | [diff] [blame] | 121 | License terms | 
|  | 122 | ------------- | 
|  | 123 | git-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 | 
|  | 125 | any modifications you make to the source code, you are very much encouraged and | 
|  | 126 | invited to contribute back your modifications to the community, preferably | 
|  | 127 | in a Github fork, of course. | 
|  | 128 |  | 
|  | 129 |  | 
| Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 130 | Typical usage: | 
|  | 131 | -------------- | 
| Vincent Driessen | b731e6f | 2010-08-19 20:00:02 +0200 | [diff] [blame] | 132 | For the best introduction to get started to `git flow`, please read Jeff | 
|  | 133 | Kreeftmeijer's blog post: | 
|  | 134 |  | 
| Vincent Driessen | 4d8b379 | 2010-08-19 20:01:30 +0200 | [diff] [blame] | 135 | [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] | 136 |  | 
| Vincent Driessen | fe1d4c9 | 2011-01-31 22:39:17 +0100 | [diff] [blame^] | 137 | Or have a look at one of these screen casts: | 
|  | 138 |  | 
|  | 139 | * [A short introduction to git-flow](http://vimeo.com/16018419) (by Mark Derricutt) | 
|  | 140 | * [On the path with git-flow](http://codesherpas.com/screencasts/on_the_path_gitflow.mov) (by Dave Bock) | 
|  | 141 |  | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 142 |  | 
| Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 143 | ### Initialization | 
|  | 144 |  | 
|  | 145 | To initialize a new repo with the basic branch structure, use: | 
| Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 146 |  | 
| Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 147 | git flow init | 
| Vincent Driessen | f9ebb07 | 2010-02-22 07:56:04 +0100 | [diff] [blame] | 148 |  | 
| Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 149 | This will then interactively prompt you with some questions on which branches | 
|  | 150 | you would like to use as development and production branches, and how you | 
|  | 151 | would like your prefixes be named. You may simply press Return on any of | 
|  | 152 | those questions to accept the (sane) default suggestions. | 
|  | 153 |  | 
|  | 154 |  | 
|  | 155 | ### Creating feature/release/hotfix/support branches | 
| Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 156 |  | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 157 | * To list/start/finish feature branches, use: | 
|  | 158 |  | 
|  | 159 | git flow feature | 
|  | 160 | git flow feature start <name> [<base>] | 
|  | 161 | git flow feature finish <name> | 
|  | 162 |  | 
| Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 163 | For feature branches, the `<base>` arg must be a commit on `develop`. | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 164 |  | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 165 | * To list/start/finish release branches, use: | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 166 |  | 
| Vincent Driessen | 04839ae | 2010-01-28 01:07:20 +0100 | [diff] [blame] | 167 | git flow release | 
| Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 168 | git flow release start <release> [<base>] | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 169 | git flow release finish <release> | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 170 |  | 
| Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 171 | For release branches, the `<base>` arg must be a commit on `develop`. | 
|  | 172 |  | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 173 | * To list/start/finish hotfix branches, use: | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 174 |  | 
| Vincent Driessen | 04839ae | 2010-01-28 01:07:20 +0100 | [diff] [blame] | 175 | git flow hotfix | 
| Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 176 | git flow hotfix start <release> [<base>] | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 177 | git flow hotfix finish <release> | 
| Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 178 |  | 
|  | 179 | For hotfix branches, the `<base>` arg must be a commit on `master`. | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 180 |  | 
|  | 181 | * To list/start support branches, use: | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 182 |  | 
| Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 183 | git flow support | 
| Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 184 | git flow support start <release> <base> | 
|  | 185 |  | 
|  | 186 | For support branches, the `<base>` arg must be a commit on `master`. | 
| Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 187 |  | 
| Vincent Driessen | b33ea8a | 2010-08-24 13:58:32 +0200 | [diff] [blame] | 188 |  | 
|  | 189 | Showing your appreciation | 
|  | 190 | ========================= | 
|  | 191 | A few people already requested it, so now it's here: a Flattr button. | 
|  | 192 |  | 
|  | 193 | Of course, the best way to show your appreciation for the original | 
|  | 194 | [blog post](http://nvie.com/git-model) or the git-flow tool itself remains | 
|  | 195 | contributing to the community.  If you'd like to show your appreciation in | 
|  | 196 | another way, however, consider Flattr'ing me: | 
|  | 197 |  | 
|  | 198 | [![Flattr this][2]][1] | 
|  | 199 |  | 
|  | 200 | [1]: http://flattr.com/thing/53771/git-flow | 
|  | 201 | [2]: http://api.flattr.com/button/button-static-50x60.png |