2012-07-31 12:59:15 +02:00
<!DOCTYPE html>
2012-08-06 19:33:03 +02:00
< html lang = "en" xmlns = "http://www.w3.org/1999/html" >
2012-07-31 12:59:15 +02:00
< head >
< meta charset = "utf-8" >
< meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" >
< title > git-flow cheatsheet< / title >
< link href = 'http://fonts.googleapis.com/css?family=Sansita+One' rel = 'stylesheet' type = 'text/css' >
2012-08-09 13:03:05 +02:00
< link rel = "stylesheet" href = "css/normalize.css" type = "text/css" media = "screen,print" >
2012-08-13 00:10:19 +02:00
< link rel = "stylesheet" href = "css/style.css" type = "text/css" media = "screen,print" >
2012-07-31 12:59:15 +02:00
< script src = "js/jquery-1.7.2.min.js" > < / script >
2012-08-09 11:28:23 +02:00
2012-07-31 12:59:15 +02:00
< script type = "text/javascript" >
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33766650-1']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
< / script >
< / head >
< body >
2013-05-14 12:27:28 +02:00
< div id = "banner" > < a href = "https://github.com/danielkummer/git-flow-cheatsheet" > Fork me on GitHub< / a > < / div >
2012-08-05 14:19:48 +02:00
< header >
2012-08-08 15:04:34 +02:00
< h1 id = "title" > git-flow cheatsheet< / h1 >
< p id = "author" >
created by < a href = "http://twitter.com/0r1g4m14dd1c7" > Daniel Kummer< / a >
< a href = "https://twitter.com/share" class = "twitter-share-button" data-via = "0r1g4m14dd1c7" data-size = "large" > Tweet< / a >
< script > ! f u n c t i o n ( d , s , i d ) {
var js, fjs = d.getElementsByTagName(s)[0];
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = "//platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
}
}(document, "script", "twitter-wjs");< / script >
< / p >
< p id = "desc" > efficient branching using git-flow by < a href = "http://nvie.com/" > Vincent Driessen< / a > < / p >
2013-03-26 13:52:27 +01:00
< p id = "translations" > translations:
< a href = "#" class = "active" title = "english" > English< / a > -
2014-11-02 01:06:03 +01:00
< a href = "index.es_ES.html" title = "spanish" > Castellano< / a > -
2013-03-26 13:52:27 +01:00
< a href = "index.pt_BR.html" title = "Brazilian Portugues" > Brazilian Portugues< / a > -
2014-12-31 05:33:54 +01:00
< a href = "index.zh_TW.html" title = "Traditional Chinese" > 繁體中文(Traditional Chinese)< / a > -
2013-06-20 07:48:57 +02:00
< a href = "index.zh_CN.html" title = "Simplified Chinese" > 简体中文(Simplified Chinese)< / a > -
2013-09-13 13:16:34 +02:00
< a href = "index.ja_JP.html" title = "日本語" > 日本語< / a > -
2014-04-20 09:28:20 +02:00
< a href = "index.tr_TR.html" title = "Turkce" > Türkçe< / a > -
< a href = "index.ko_KR.html" title = "한국어" > 한국어(Korean)< / a > -
< a href = "index.fr_FR.html" title = "Français" > Français< / a > -
2014-07-09 10:44:00 +02:00
< a href = "index.it_IT.html" title = "Italiano" > Italiano< / a > -
2014-07-18 17:15:17 +02:00
< a href = "index.nl_NL.html" title = "Nederlands" > Nederlands< / a > -
2014-11-02 02:15:40 +01:00
< a href = "index.ru_RU.html" title = "Russian" > Русский (Russian)< / a > -
2014-12-01 19:02:54 +01:00
< a href = "index.de_DE.html" title = "German" > Deutsch (German)< / a > -
2015-04-13 22:42:30 +02:00
< a href = "index.ca_CA.html" title = "Català" > Català (Catalan)< / a > -
2015-06-05 13:18:28 +02:00
< a href = "index.ro_RO.html" title = "Romanian" > Română (Romanian)< / a > -
< a href = "index.el_GR.html" title = "Ελληνικά (Greek)" > Ελληνικά (Greek)< / a >
2013-03-26 13:52:27 +01:00
< / p >
2012-08-05 14:19:48 +02:00
< / header >
< div id = "main" >
2012-08-09 11:28:23 +02:00
2012-08-05 14:19:48 +02:00
2012-08-06 19:33:03 +02:00
< div class = "scrollblock" >
2012-08-09 11:28:23 +02:00
< h2 > About< / h2 >
2012-08-06 19:33:03 +02:00
< p >
git-flow are a set of git extensions to provide high-level repository operations for Vincent
Driessen's branching model.
< small > < a href = "http://nvie.com/posts/a-successful-git-branching-model/" > more< / a > < / small >
< / p >
< p class = "divider" > ★ ★ ★ < / p >
< p > This cheatsheet shows the basic usage and effect of git-flow operations< / p >
< p class = "divider" > ★ ★ ★ < / p >
< / div >
< div class = "scrollblock" >
2012-08-09 11:28:23 +02:00
< h2 > Basic tips< / h2 >
2012-08-06 19:33:03 +02:00
< ul >
< li > Git flow provides excellent command line help and output. Read it carefully to see what's happening...< / li >
2013-08-21 14:20:05 +02:00
< li > The OSX/Windows Client < a href = "http://www.sourcetreeapp.com/" > Sourcetree< / a > is an excellent git gui and provides
2012-08-06 19:33:03 +02:00
git-flow support
< / li >
2013-08-21 14:20:05 +02:00
< li > Git-flow is a merge based solution. It doesn't rebase feature branches.< / li >
2012-08-06 19:33:03 +02:00
< / ul >
< p class = "divider" > ★ ★ ★ < / p >
< / div >
2012-08-05 14:19:48 +02:00
2012-08-12 15:58:13 +02:00
< div class = "scrollblock" >
2012-11-20 10:50:17 +01:00
< h2 > < a name = "setup" href = "#setup" > Setup< / a > < / h2 >
2012-08-13 00:10:19 +02:00
< ul >
< li > You need a working git installation as prerequisite.< / li >
< li > Git flow works on OSX, Linux and Windows< / li >
< / ul >
2012-08-12 15:58:13 +02:00
< p class = "divider" > ★ ★ ★ < / p >
2012-08-06 19:33:03 +02:00
< div class = "col-1" >
< h3 > OSX< / h3 >
2014-10-21 10:56:38 +02:00
< span > Homebrew< / span >
2012-08-06 19:33:03 +02:00
< blockquote >
2012-08-13 00:10:19 +02:00
$ brew install git-flow
2012-08-06 19:33:03 +02:00
< / blockquote >
2014-10-21 10:56:38 +02:00
< span > Macports< / span >
< blockquote >
$ port install git-flow
< / blockquote >
2012-08-06 19:33:03 +02:00
< h3 > Linux< / h3 >
< blockquote >
2012-08-13 00:10:19 +02:00
$ apt-get install git-flow
2012-08-06 19:33:03 +02:00
< / blockquote >
< h3 > Windows (Cygwin)< / h3 >
< blockquote >
2012-08-13 00:10:19 +02:00
$ wget -q -O - --no-check-certificate
https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | bash
2012-08-06 19:33:03 +02:00
< / blockquote >
2012-11-14 20:53:26 +01:00
< p > You need wget and util-linux to install git-flow.< / p >
2012-08-06 19:33:03 +02:00
< / div >
< div class = "col-2" >
2012-08-05 14:19:48 +02:00
< p >
2012-08-13 00:10:19 +02:00
For detailed git flow intallation instructions please visit the < a href = "https://github.com/nvie/gitflow/wiki/Windows" > git flow
2012-08-06 19:33:03 +02:00
wiki< / a > .
2012-08-05 14:19:48 +02:00
< / p >
2012-08-06 19:33:03 +02:00
< img src = "img/download.png" alt = "install git-flow" / >
< / div >
< / div >
< div class = "scrollblock" >
2012-11-20 10:50:17 +01:00
< h2 > < a name = "getting_started" href = "#getting_started" > Getting started< / a > < / h2 >
2012-08-13 00:10:19 +02:00
< p > Git flow needs to be initialized in order to customize your project setup.< / p >
< p class = "divider" > ★ ★ ★ < / p >
2012-08-06 19:33:03 +02:00
< div class = "col-1" >
< h3 > Initialize< / h3 >
2012-08-05 14:19:48 +02:00
2012-08-06 19:33:03 +02:00
< p > Start using git-flow by initializing it inside an existing git repository:< / p >
< blockquote >
2012-08-13 00:10:19 +02:00
git flow init
2012-08-06 19:33:03 +02:00
< / blockquote >
< p >
You'll have to answer a few questions regarding the naming conventions for your branches.< br / >
It's recommended to use the default values.
< / p >
< / div >
< div class = "col-2" >
2012-08-09 11:28:23 +02:00
< div class = "initialize" > < / div >
< div class = "lines-small" > < / div >
< div class = "lines-open" > < / div >
< div class = "lines-big" > < / div >
2012-08-08 15:04:34 +02:00
< / div >
< / div >
2012-08-05 14:19:48 +02:00
2012-08-12 15:58:13 +02:00
< div class = "scrollblock" >
2012-11-20 10:50:17 +01:00
< h2 > < a name = "features" href = "#features" > Features< / a > < / h2 >
2012-08-13 00:10:19 +02:00
2012-08-06 19:33:03 +02:00
< ul class = "narrow" >
< li > Develop new features for upcoming releases< / li >
< li > Typically exist in developers repos only< / li >
< / ul >
2012-08-13 00:10:19 +02:00
< p class = "divider" > ★ ★ ★ < / p >
2012-08-06 19:33:03 +02:00
< div class = "col-1" >
< h3 > Start a new feature< / h3 >
< p > Development of new features starting from the 'develop' branch.< / p >
< p > Start developing a new feature with< / p >
< blockquote >
2012-08-17 08:40:14 +02:00
git flow feature start MYFEATURE
2012-08-06 19:33:03 +02:00
< / blockquote >
< p > This action creates a new feature branch based on 'develop' and switches to it< / p >
2012-08-08 15:04:34 +02:00
<!--
- Bump the version number now!
- Start committing last-minute fixes in preparing your release
- When done, run:
git flow release finish 'testrelease'
-->
2012-08-06 19:33:03 +02:00
< / div >
< div class = "col-2" >
2012-08-09 11:28:23 +02:00
< div class = "feature-start" > < / div >
2012-08-06 19:33:03 +02:00
< / div >
< / div >
2012-08-05 14:19:48 +02:00
2012-08-06 19:33:03 +02:00
< div class = "scrollblock" >
< div class = "col-1" >
< h3 > Finish up a feature< / h3 >
2012-08-05 14:19:48 +02:00
2012-08-06 19:33:03 +02:00
< p >
Finish the development of a feature.
This action performs the following
< / p >
< ul >
< li > Merged MYFEATURE into 'develop'< / li >
< li > Removes the feature branch< / li >
< li > Switches back to 'develop' branch< / li >
< / ul >
< blockquote >
2012-08-17 08:40:14 +02:00
git flow feature finish MYFEATURE
2012-08-06 19:33:03 +02:00
< / blockquote >
< / div >
< div class = "col-2" >
2012-08-09 11:28:23 +02:00
< div class = "feature-end" > < / div >
2012-08-06 19:33:03 +02:00
< / div >
< / div >
2012-08-05 14:19:48 +02:00
2012-08-06 19:33:03 +02:00
< div class = "scrollblock" >
< div class = "col-1" >
< h3 > Publish a feature< / h3 >
2012-08-05 14:19:48 +02:00
2012-08-06 19:33:03 +02:00
< p >
Are you developing a feature in collaboration? < br / >
Publish a feature to the remote server so it can be used by other users.
< / p >
2012-08-05 14:19:48 +02:00
2012-08-06 19:33:03 +02:00
< blockquote >
2012-08-17 08:40:14 +02:00
git flow feature publish MYFEATURE
2012-08-06 19:33:03 +02:00
< / blockquote >
2012-08-05 14:19:48 +02:00
< / div >
2012-08-06 19:33:03 +02:00
< div class = "col-2" >
2012-08-09 12:52:39 +02:00
< div class = "feature-publish" > < / div >
2012-08-06 19:33:03 +02:00
< / div >
< / div >
2012-08-05 14:19:48 +02:00
2012-08-06 19:33:03 +02:00
< div class = "scrollblock" >
< div class = "col-1" >
< h3 > Getting a published feature< / h3 >
2012-08-08 15:04:34 +02:00
2012-08-06 19:33:03 +02:00
< p >
2013-11-19 10:35:04 +01:00
Get a feature published by another user.
2012-08-06 19:33:03 +02:00
< / p >
2012-08-05 14:19:48 +02:00
2012-08-06 19:33:03 +02:00
< blockquote >
2013-11-19 10:35:04 +01:00
git flow feature pull origin MYFEATURE
2012-08-06 19:33:03 +02:00
< / blockquote >
2013-11-19 10:35:04 +01:00
< p > You can track a feature on origin by using < code > git flow feature track MYFEATURE< / code > < / p >
2012-08-05 14:19:48 +02:00
< / div >
2012-08-06 19:33:03 +02:00
< div class = "col-2" >
2012-08-09 12:52:39 +02:00
< div class = "feature-pull" > < / div >
2012-08-05 14:19:48 +02:00
< / div >
2012-08-06 19:33:03 +02:00
< / div >
2012-08-05 14:19:48 +02:00
2012-08-12 15:58:13 +02:00
< div class = "scrollblock" >
2012-11-20 10:50:17 +01:00
< h2 > < a name = "release" href = "#release" > Make a release< / a > < / h2 >
2012-08-05 14:19:48 +02:00
2012-08-06 19:33:03 +02:00
< ul >
< li > Support preparation of a new production release< / li >
< li > Allow for minor bug fixes and preparing meta-data for a release< / li >
< / ul >
2012-08-13 00:10:19 +02:00
< p class = "divider" > ★ ★ ★ < / p >
2012-08-06 19:33:03 +02:00
< div class = "col-1" >
< h3 > Start a release< / h3 >
2012-08-05 14:19:48 +02:00
2014-11-02 02:15:40 +01:00
< p > To start a release, use the git flow release command. It creates a release branch created from the 'develop' branch.< / p >
2012-08-06 19:33:03 +02:00
< blockquote >
2012-08-13 00:10:19 +02:00
git flow release start RELEASE [BASE]
2012-08-06 19:33:03 +02:00
< / blockquote >
< p > You can optionally supply a < code > [BASE]< / code > commit sha-1 hash to start the release from. The commit must
be on the
'develop' branch.< / p >
2012-08-17 08:40:14 +02:00
< p class = "divider" > ★ ★ ★ < / p >
< p > It's wise to publish the release branch after creating it to allow release commits by other developers. Do it similar to feature publishing with the command:< / p >
< blockquote >
git flow release publish RELEASE
< / blockquote >
< p > (You can track a remote release with the < br / > < code > git flow release track RELEASE< / code > command)< / p >
2012-08-06 19:33:03 +02:00
< / div >
< div class = "col-2" >
2012-08-09 11:28:23 +02:00
< div class = "release-start" > < / div >
2012-08-06 19:33:03 +02:00
< / div >
< / div >
2012-08-05 14:19:48 +02:00
2012-08-12 15:58:13 +02:00
< div class = "scrollblock" >
2012-08-06 19:33:03 +02:00
< div class = "col-1" >
< h3 > Finish up a release< / h3 >
< p > Finishing a release is one of the big steps in git branching. It performs several actions:< / p >
< ul >
< li > Merges the release branch back into 'master'< / li >
2013-08-21 14:20:05 +02:00
< li > Tags the release with its name< / li >
2012-08-06 19:33:03 +02:00
< li > Back-merges the release into 'develop'< / li >
< li > Removes the release branch< / li >
< / ul >
< blockquote >
2012-08-13 00:10:19 +02:00
git flow release finish RELEASE
2012-08-06 19:33:03 +02:00
< / blockquote >
2013-08-21 14:20:05 +02:00
< p > Don't forget to push your tags with< code > git push --tags< / code > < / p >
2012-08-06 19:33:03 +02:00
< / div >
< div class = "col-2" >
2012-08-09 11:28:23 +02:00
< div class = "release-end" > < / div >
2012-08-09 12:52:39 +02:00
2012-08-06 19:33:03 +02:00
< / div >
< / div >
2012-08-05 14:19:48 +02:00
2012-08-12 15:58:13 +02:00
< div class = "scrollblock" >
2012-11-20 10:50:17 +01:00
< h2 > < a name = "hotfixes" href = "#hotfixes" > Hotfixes< / a > < / h2 >
2012-08-06 19:33:03 +02:00
< ul >
< li > Hotfixes arise from the necessity to act immediately upon an undesired state of a live production version
< / li >
< li > May be branched off from the corresponding tag on the master branch that marks the production version.< / li >
< / ul >
2012-08-13 00:10:19 +02:00
< p class = "divider" > ★ ★ ★ < / p >
2012-08-06 19:33:03 +02:00
< div class = "col-1" >
< h3 > git flow hotfix start< / h3 >
< p > Like the other git flow commands, a hotfix is started with< / p >
< blockquote >
2012-11-14 20:53:26 +01:00
git flow hotfix start VERSION [BASENAME]
2012-08-06 19:33:03 +02:00
< / blockquote >
2012-11-14 20:53:26 +01:00
< p > The version argument hereby marks the new hotfix release name. Optionally you can specify a basename to start from.< / p >
2012-08-06 19:33:03 +02:00
< / div >
< div class = "col-2" >
2012-08-09 11:28:23 +02:00
< div class = "hotfix-start" > < / div >
2012-08-06 19:33:03 +02:00
< / div >
< / div >
2012-08-05 14:19:48 +02:00
2012-08-06 19:33:03 +02:00
< div class = "scrollblock" >
< div class = "col-1" >
< h3 > Finish a hotfix< / h3 >
2013-09-12 20:30:53 +02:00
< p > By finishing a hotfix it gets merged back into develop and master. Additionally the master merge is tagged with the hotfix version.< / p >
2012-08-17 08:40:14 +02:00
< blockquote >
2012-11-14 20:53:26 +01:00
git flow hotfix finish VERSION
2012-08-17 08:40:14 +02:00
< / blockquote >
2012-08-05 14:19:48 +02:00
< / div >
2012-08-06 19:33:03 +02:00
< div class = "col-2" >
2012-08-09 12:52:39 +02:00
< div class = "hotfix-end" > < / div >
2012-08-08 15:04:34 +02:00
< / div >
< / div >
2012-08-09 11:28:23 +02:00
< div >
2012-08-08 15:04:34 +02:00
< div class = "col-1" > < / div >
< div class = "col-2" >
2012-08-09 11:28:23 +02:00
< div class = "lines-close" > < / div >
< div class = "lines-small-end" > < / div >
2012-08-05 14:19:48 +02:00
< / div >
2012-08-06 19:33:03 +02:00
< / div >
2012-09-07 09:38:08 +02:00
< div class = "scrollblock" >
2012-11-20 10:50:17 +01:00
< h2 > < a name = "commands" href = "#commands" > Commands< / a > < / h2 >
2012-09-07 09:38:08 +02:00
< img src = "img/git-flow-commands.png" alt = "git-flow commands" / >
< / div >
2012-08-06 19:33:03 +02:00
< div class = "scrollblock" >
< h2 > Backlog< / h2 >
2012-08-13 00:10:19 +02:00
< p class = "divider" > ★ ★ ★ < / p >
2012-08-06 19:33:03 +02:00
< ul >
< li > Not all available commands are covered here, only the most important ones< / li >
< li > You can still use git and all its commands normally as you know them, git flow is only a tooling
collection
< / li >
< li > The 'support' feature is still beta, using it is not advised< / li >
2012-09-07 09:38:08 +02:00
< li > If you'd like to supply translations I'd be happy to integrate them< / li >
2012-08-06 19:33:03 +02:00
< / ul >
2012-08-13 00:10:19 +02:00
< p class = "divider" > ★ ★ ★ < / p >
2012-08-06 19:33:03 +02:00
< / div >
< / div >
2012-09-07 09:38:08 +02:00
2012-08-08 15:04:34 +02:00
< footer >
< div class = "scrollblock" >
2012-11-20 10:50:17 +01:00
< h2 > < a name = "comments" href = "#comments" > Comments< / a > < / h2 >
2012-07-31 12:59:15 +02:00
2012-08-08 15:04:34 +02:00
< div id = "disqus_thread" > < / div >
< / div >
< / footer >
2012-07-31 12:59:15 +02:00
2012-08-06 19:33:03 +02:00
< script type = "text/javascript" >
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'gitflowcheatsheet'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
2012-07-31 12:59:15 +02:00
< / script >
2012-08-06 19:33:03 +02:00
< noscript > Please enable JavaScript to view the < a href = "http://disqus.com/?ref_noscript" > comments powered by Disqus.< / a >
< / noscript >
< a href = "http://disqus.com" class = "dsq-brlink" > comments powered by < span class = "logo-disqus" > Disqus< / span > < / a >
2012-07-31 12:59:15 +02:00
< / body >
2013-06-20 07:48:57 +02:00
< / html >