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 | |
JP Toto | ac949bf | 2010-08-20 05:01:52 +0800 | [diff] [blame] | 15 | 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] | 16 | first to install tools like sh and wget. Then simply follow the command: |
| 17 | |
| 18 | c:\Users\<user> wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh |
| 19 | |
Vincent Driessen | 4f0f539 | 2010-07-10 17:05:27 +0200 | [diff] [blame] | 20 | If you prefer a manual installation, please use the following instructions. |
Vincent Driessen | 13c9482 | 2010-02-15 20:09:02 +0100 | [diff] [blame] | 21 | After downloading the sources from Github, also fetch the submodules: |
| 22 | |
| 23 | $ git submodule init |
| 24 | $ git submodule update |
| 25 | |
| 26 | Then, you can install `git-flow`, using: |
Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 27 | |
Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 28 | $ sudo make install |
Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 29 | |
Vincent Driessen | e0b54c0 | 2010-03-19 19:27:38 +0100 | [diff] [blame] | 30 | By default, git-flow will be installed in /usr/local. To change the prefix |
| 31 | where git-flow will be installed, simply specify it explicitly, using: |
Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 32 | |
Vincent Driessen | e0b54c0 | 2010-03-19 19:27:38 +0100 | [diff] [blame] | 33 | $ sudo make prefix=/opt/local install |
Vincent Driessen | dd720be | 2010-01-27 00:00:09 +0100 | [diff] [blame] | 34 | |
| 35 | Or simply point your `PATH` environment variable to your git-flow checkout |
| 36 | directory. |
Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 37 | |
Vincent Driessen | b17b898 | 2010-08-25 21:25:36 +0200 | [diff] [blame^] | 38 | *Installation note:* |
| 39 | git-flow depends on the availability of the command line utility `getopt`, |
| 40 | which may not be available in your Unix/Linux environment. Please use your |
| 41 | favorite package manager to install `getopt`. For Cygwin, install the |
| 42 | `util-linux` package to get `getopt`. |
| 43 | |
Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 44 | |
Vincent Driessen | ec0b854 | 2010-07-22 14:57:16 +0200 | [diff] [blame] | 45 | Integration with your shell |
| 46 | --------------------------- |
| 47 | For those who use the [Bash](http://www.gnu.org/software/bash/) shell, please |
| 48 | check out the excellent work on the |
| 49 | [git-flow-completion](http://github.com/bobthecow/git-flow-completion) project |
| 50 | by [bobthecow](http://github.com/bobthecow). It offers tab-completion for all |
| 51 | git-flow subcommands and branch names. |
| 52 | |
| 53 | If you are a [zsh](http://www.zsh.org) user with some plugin-writing |
| 54 | experience, please help us develop a |
| 55 | [completion plugin](http://github.com/bobthecow/git-flow-completion/issues#issue/1) |
| 56 | for zsh, too. Please contact me on [Github](http://github.com/inbox/new/nvie) |
| 57 | or [Twitter](http://twitter.com/nvie) to discuss details. |
| 58 | |
JP Toto | ac949bf | 2010-08-20 05:01:52 +0800 | [diff] [blame] | 59 | For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good starting place for installing git. |
| 60 | |
Vincent Driessen | ec0b854 | 2010-07-22 14:57:16 +0200 | [diff] [blame] | 61 | |
Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 62 | Please help out |
| 63 | --------------- |
Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 64 | This project is still under development. Feedback and suggestions are very |
| 65 | welcome and I encourage you to use the [Issues |
| 66 | list](http://github.com/nvie/gitflow/issues) on Github to provide that |
Vincent Driessen | f206ba6 | 2010-01-26 12:44:41 +0100 | [diff] [blame] | 67 | feedback. |
Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 68 | |
Vincent Driessen | d79a0d4 | 2010-04-04 16:11:44 +0200 | [diff] [blame] | 69 | Feel free to fork this repo and to commit your additions. For a list of all |
| 70 | contributors, please see the [AUTHORS](AUTHORS) file. |
Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 71 | |
Vincent Driessen | 1fd5bcf | 2010-07-15 23:21:21 -0700 | [diff] [blame] | 72 | 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] | 73 | [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] | 74 | |
Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 75 | |
Vincent Driessen | 5d1dbe7 | 2010-04-04 15:52:55 +0200 | [diff] [blame] | 76 | License terms |
| 77 | ------------- |
| 78 | git-flow is published under the liberal terms of the BSD License, see the |
| 79 | [LICENSE](LICENSE) file. Although the BSD License does not require you to share |
| 80 | any modifications you make to the source code, you are very much encouraged and |
| 81 | invited to contribute back your modifications to the community, preferably |
| 82 | in a Github fork, of course. |
| 83 | |
| 84 | |
Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 85 | Typical usage: |
| 86 | -------------- |
Vincent Driessen | b731e6f | 2010-08-19 20:00:02 +0200 | [diff] [blame] | 87 | For the best introduction to get started to `git flow`, please read Jeff |
| 88 | Kreeftmeijer's blog post: |
| 89 | |
Vincent Driessen | 4d8b379 | 2010-08-19 20:01:30 +0200 | [diff] [blame] | 90 | [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] | 91 | |
Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 92 | |
Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 93 | ### Initialization |
| 94 | |
| 95 | To initialize a new repo with the basic branch structure, use: |
Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 96 | |
Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 97 | git flow init |
Vincent Driessen | f9ebb07 | 2010-02-22 07:56:04 +0100 | [diff] [blame] | 98 | |
Vincent Driessen | c49c793 | 2010-02-24 01:22:48 +0100 | [diff] [blame] | 99 | This will then interactively prompt you with some questions on which branches |
| 100 | you would like to use as development and production branches, and how you |
| 101 | would like your prefixes be named. You may simply press Return on any of |
| 102 | those questions to accept the (sane) default suggestions. |
| 103 | |
| 104 | |
| 105 | ### Creating feature/release/hotfix/support branches |
Vincent Driessen | 12c4ab4 | 2010-01-26 22:11:19 +0100 | [diff] [blame] | 106 | |
Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 107 | * To list/start/finish feature branches, use: |
| 108 | |
| 109 | git flow feature |
| 110 | git flow feature start <name> [<base>] |
| 111 | git flow feature finish <name> |
| 112 | |
Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 113 | For feature branches, the `<base>` arg must be a commit on `develop`. |
Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 114 | |
Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 115 | * To list/start/finish release branches, use: |
Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 116 | |
Vincent Driessen | 04839ae | 2010-01-28 01:07:20 +0100 | [diff] [blame] | 117 | git flow release |
Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 118 | git flow release start <release> [<base>] |
Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 119 | git flow release finish <release> |
Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 120 | |
Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 121 | For release branches, the `<base>` arg must be a commit on `develop`. |
| 122 | |
Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 123 | * To list/start/finish hotfix branches, use: |
Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 124 | |
Vincent Driessen | 04839ae | 2010-01-28 01:07:20 +0100 | [diff] [blame] | 125 | git flow hotfix |
Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 126 | git flow hotfix start <release> [<base>] |
Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 127 | git flow hotfix finish <release> |
Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 128 | |
| 129 | For hotfix branches, the `<base>` arg must be a commit on `master`. |
Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 130 | |
| 131 | * To list/start support branches, use: |
Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 132 | |
Vincent Driessen | c81e7a2 | 2010-01-28 00:33:24 +0100 | [diff] [blame] | 133 | git flow support |
Vincent Driessen | 010252a | 2010-02-04 10:31:29 +0100 | [diff] [blame] | 134 | git flow support start <release> <base> |
| 135 | |
| 136 | For support branches, the `<base>` arg must be a commit on `master`. |
Vincent Driessen | 78c73dc | 2010-01-21 00:48:44 +0100 | [diff] [blame] | 137 | |
Vincent Driessen | b33ea8a | 2010-08-24 13:58:32 +0200 | [diff] [blame] | 138 | |
| 139 | Showing your appreciation |
| 140 | ========================= |
| 141 | A few people already requested it, so now it's here: a Flattr button. |
| 142 | |
| 143 | Of course, the best way to show your appreciation for the original |
| 144 | [blog post](http://nvie.com/git-model) or the git-flow tool itself remains |
| 145 | contributing to the community. If you'd like to show your appreciation in |
| 146 | another way, however, consider Flattr'ing me: |
| 147 | |
| 148 | [![Flattr this][2]][1] |
| 149 | |
| 150 | [1]: http://flattr.com/thing/53771/git-flow |
| 151 | [2]: http://api.flattr.com/button/button-static-50x60.png |