{"id":309,"date":"2012-01-07T23:46:31","date_gmt":"2012-01-07T23:46:31","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2012\/01\/07\/a-successful-git-branching-model\/"},"modified":"2021-11-19T09:50:41","modified_gmt":"2021-11-19T09:50:41","slug":"a-successful-git-branching-model","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/a-successful-git-branching-model\/","title":{"rendered":"A Successful Git branching model | Git branching model Guide"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3855 aligncenter\" src=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2012\/01\/git-branching-mode.png\" alt=\"successful-git-branching-model\" width=\"600\" height=\"400\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2012\/01\/git-branching-mode.png 600w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2012\/01\/git-branching-mode-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>I was reading article and thought to repost here.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\"><img decoding=\"async\" class=\"center\" style=\"max-width: 580px; display: block; margin: 0px auto 0px auto; border: initial none initial;\" src=\"http:\/\/nvie.com\/img\/2009\/12\/Screen-shot-2009-12-24-at-11.32.03.png\" border=\"0\"><\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">It focuses around&nbsp;<a style=\"color: #3270ae;\" href=\"http:\/\/git-scm.com\/\" target=\"_blank\" rel=\"noopener\">Git<\/a> as the tool for the versioning of all of our source code.<\/p>\n<h2 style=\"font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; line-height: normal; padding: 0px; margin: 24px 0px 12px 0px;\">Why git?<\/h2>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">For a thorough discussion on the pros and cons of Git compared to centralized source code control systems,&nbsp;<a style=\"color: #3270ae;\" href=\"http:\/\/whygitisbetterthanx.com\/\" target=\"_blank\" rel=\"noopener\">see<\/a> <a style=\"color: #3270ae;\" href=\"http:\/\/www.looble.com\/git-vs-svn-which-is-better\/\" target=\"_blank\" rel=\"noopener\">the<\/a> <a style=\"color: #3270ae;\" href=\"http:\/\/git.or.cz\/gitwiki\/GitSvnComparsion\" target=\"_blank\" rel=\"noopener\">web<\/a>. There are plenty of flame wars going on there. As a developer, I prefer Git above all other tools around today. Git really changed the way developers think of merging and branching. From the classic&nbsp;<span class=\"caps\">CVS<\/span>\/Subversion world I came from, merging\/branching has always been considered a bit scary (\u201cbeware of merge conflicts, they bite you!\u201d) and something you only do every once in a while.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">But with Git, these actions are extremely cheap and simple, and they are considered one of the core parts of your&nbsp;<em>daily<\/em> workflow, really. For example, in&nbsp;<span class=\"caps\">CVS<\/span>\/Subversion&nbsp;<a style=\"color: #3270ae;\" href=\"http:\/\/svnbook.red-bean.com\/\" target=\"_blank\" rel=\"noopener\">books<\/a>, branching and merging is first discussed in the later chapters (for advanced users), while in&nbsp;<a style=\"color: #3270ae;\" href=\"http:\/\/book.git-scm.com\/\" target=\"_blank\" rel=\"noopener\">every<\/a> <a style=\"color: #3270ae;\" href=\"http:\/\/pragprog.com\/titles\/tsgit\/pragmatic-version-control-using-git\" target=\"_blank\" rel=\"noopener\">Git<\/a> <a style=\"color: #3270ae;\" href=\"http:\/\/github.com\/progit\/progit\" target=\"_blank\" rel=\"noopener\">book<\/a>, it\u2019s already covered in chapter 3 (basics).<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">As a consequence of its simplicity and repetitive nature, branching and merging are no longer something to be afraid of. Version control tools are supposed to assist in branching\/merging more than anything else.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Enough about the tools, let\u2019s head onto the development model. The model that I\u2019m going to present here is essentially no more than a set of procedures that every team member has to follow in order to come to a managed software development process.<\/p>\n<h2 style=\"font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; line-height: normal; padding: 0px; margin: 24px 0px 12px 0px;\">Decentralized but centralized<\/h2>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">The repository setup that we use and that works well with this branching model, is that with a central \u201ctruth\u201d repo. Note that this repo&nbsp;is only&nbsp;<em>considered<\/em> to be the central one (since Git is a&nbsp;<span class=\"caps\">DVCS<\/span>, there is no such thing as a central repo at a technical level).&nbsp;We will refer to this repo as&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">origin<\/code>, since this name is familiar to all Git users.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\"><img decoding=\"async\" class=\"center\" style=\"max-width: 580px; display: block; margin: 0px auto 0px auto; border: initial none initial;\" src=\"http:\/\/nvie.com\/img\/2010\/01\/centr-decentr.png\" border=\"0\"><\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Each developer pulls and pushes to origin. But besides the centralized push-pull relationships, each developer may also pull changes from other peers to form sub teams. For example, this might be useful to work together with two or more developers on a big new feature, before pushing the work in progress to&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">origin<\/code> prematurely. In the figure above, there are subteams of Alice and Bob, Alice and David, and Clair and David.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Technically, this means nothing more than that Alice has defined a Git remote, named&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">bob<\/code>, pointing to Bob\u2019s repository, and vice versa.<\/p>\n<h2 style=\"font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; line-height: normal; padding: 0px; margin: 24px 0px 12px 0px;\">The main branches<\/h2>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\"><img decoding=\"async\" class=\"right\" style=\"max-width: 580px; float: right; margin: 0px 0px 12px 12px; border: initial none initial;\" src=\"http:\/\/nvie.com\/img\/2009\/12\/bm002.png\" border=\"0\"><\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">At the core, the development model is greatly inspired by existing models out there.&nbsp;The central repo holds two main branches with an infinite lifetime:<\/p>\n<ul style=\"font-family: Georgia, Arial, sans-serif; line-height: normal; font-size: medium; margin: -12px 0px 20px 0px;\">\n<li style=\"font-size: 15px; line-height: 20px; list-style-type: square;\"><code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code><\/li>\n<li style=\"font-size: 15px; line-height: 20px; list-style-type: square;\"><code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code><\/li>\n<\/ul>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">The&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code> branch at&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">origin<\/code> should be familiar to every Git user.&nbsp;Parallel to the&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code> branch, another branch exists called&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code>.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">We consider&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">origin\/master<\/code> to be the main branch where the source code of&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">HEAD<\/code> always reflects a<em>production-ready<\/em> state.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">We consider&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">origin\/develop<\/code> to be the main branch where the source code of&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">HEAD<\/code> always reflects a state with the latest delivered development changes for the next release. Some would call this the \u201cintegration branch\u201d. This is where any automatic nightly builds are built from.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">When the source code in the&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> branch reaches a stable point and is ready to be released, all of the changes should be merged back into&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code> somehow and then tagged with a release number. How this is done in detail will be discussed further on.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Therefore, each time when changes are merged back into&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code>, this is a new production release&nbsp;<em>by definition<\/em>.&nbsp;We tend to be very strict at this, so that theoretically, we could use a Git hook script to automatically build and roll-out our software to our production servers everytime there was a commit on&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code>.<\/p>\n<h2 style=\"font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; line-height: normal; padding: 0px; margin: 24px 0px 12px 0px;\">Supporting branches<\/h2>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Next to the main branches&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code> and&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code>, our development model uses a variety of supporting branches to aid parallel development between team members, ease tracking of features, prepare for production releases and to assist in quickly fixing live production problems. Unlike the main branches, these branches always have a limited life time, since they will be removed eventually.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">The different types of branches we may use are:<\/p>\n<ul style=\"font-family: Georgia, Arial, sans-serif; line-height: normal; font-size: medium; margin: -12px 0px 20px 0px;\">\n<li style=\"font-size: 15px; line-height: 20px; list-style-type: square;\">Feature branches<\/li>\n<li style=\"font-size: 15px; line-height: 20px; list-style-type: square;\">Release branches<\/li>\n<li style=\"font-size: 15px; line-height: 20px; list-style-type: square;\">Hotfix branches<\/li>\n<\/ul>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Each of these branches have a specific purpose and are bound to strict rules as to which branches may be their originating branch and which branches must be their merge targets. We will walk through them in a minute.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">By no means are these branches \u201cspecial\u201d from a technical perspective. The branch types are categorized by how we&nbsp;<em>use<\/em> them. They are of course plain old Git branches.<\/p>\n<h3 style=\"font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; color: #333333; line-height: normal; padding: 0px; margin: 0px;\">Feature branches<\/h3>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\"><img decoding=\"async\" class=\"right\" style=\"max-width: 580px; float: right; margin: 0px 0px 12px 12px; border: initial none initial;\" src=\"http:\/\/nvie.com\/img\/2009\/12\/fb.png\" border=\"0\"><\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">May branch off from:&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code><br>\nMust merge back into:&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code><br>\nBranch naming convention: anything except&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code>,&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code>,<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">release-*<\/code>, or&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">hotfix-*<\/code><\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Feature branches (or sometimes called topic branches) are used to develop new features for the upcoming or a distant future release. When starting development of a feature, the target release in which this feature will be incorporated may well be unknown at that point. The essence of a feature branch is that it exists as long as the feature is in development, but will eventually be merged back into&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code>(to definitely add the new feature to the upcoming release) or discarded (in case of a disappointing experiment).<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Feature branches typically exist in developer repos only, not in<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">origin<\/code>.<\/p>\n<h4 style=\"font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; line-height: normal; font-size: medium; padding: 0px; margin: 0px;\">Creating a feature branch<\/h4>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">When starting work on a new feature, branch off from the&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> branch.<\/p>\n<pre style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; line-height: 1.4em; color: #222222; border-image: initial; display: table; border-bottom-right-radius: 12px; box-shadow: #cccccc 2px 3px 5px; -webkit-box-shadow: #cccccc 2px 3px 5px; overflow-x: hidden; overflow-y: hidden; border-width: 1px 1px 1px 5px; border-color: #f7a600; border-style: solid; padding: 10px 16px 10px 16px; margin: -10px 20px 20px 20px;\"><code class=\"language-console\" style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; display: block; max-width: 520px; overflow-x: visible; overflow-y: visible; padding: 0px; margin: 0px;\"><span class=\"gp\" style=\"color: #555555;\">$<\/span> git checkout -b myfeature develop <span class=\"go\" style=\"color: #888888;\">Switched to a new branch \"myfeature\"<\/span><\/code><\/pre>\n<h4 style=\"font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; line-height: normal; font-size: medium; padding: 0px; margin: 0px;\">Incorporating a finished feature on develop<\/h4>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Finished features may be merged into the&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> branch definitely add them to the upcoming release:<\/p>\n<pre style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; line-height: 1.4em; color: #222222; border-image: initial; display: table; border-bottom-right-radius: 12px; box-shadow: #cccccc 2px 3px 5px; -webkit-box-shadow: #cccccc 2px 3px 5px; overflow-x: hidden; overflow-y: hidden; border-width: 1px 1px 1px 5px; border-color: #f7a600; border-style: solid; padding: 10px 16px 10px 16px; margin: -10px 20px 20px 20px;\"><code class=\"language-console\" style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; display: block; max-width: 520px; overflow-x: visible; overflow-y: visible; padding: 0px; margin: 0px;\"><span class=\"gp\" style=\"color: #555555;\">$<\/span> git checkout develop <span class=\"go\" style=\"color: #888888;\">Switched to branch 'develop'<\/span> <span class=\"gp\" style=\"color: #555555;\">$<\/span> git merge --no-ff myfeature <span class=\"go\" style=\"color: #888888;\">Updating ea1b82a..05e9557<\/span> <span class=\"go\" style=\"color: #888888;\">(Summary of changes)<\/span> <span class=\"gp\" style=\"color: #555555;\">$<\/span> git branch -d myfeature <span class=\"go\" style=\"color: #888888;\">Deleted branch myfeature (was 05e9557).<\/span> <span class=\"gp\" style=\"color: #555555;\">$<\/span> git push origin develop<\/code><\/pre>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">The&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">--no-ff<\/code> flag causes the merge to always create a new commit object, even if the merge could be performed with a fast-forward. This avoids losing information about the historical existence of a feature branch and groups together all commits that together added the feature. Compare:<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\"><img decoding=\"async\" class=\"center\" style=\"max-width: 580px; display: block; margin: 0px auto 0px auto; border: initial none initial;\" src=\"http:\/\/nvie.com\/img\/2010\/01\/merge-without-ff.png\" border=\"0\"><\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">In the latter case, it is impossible to see from the Git history which of the commit objects together have implemented a feature\u2014you would have to manually read all the log messages. Reverting a whole feature (i.e. a group of commits), is a true headache in the latter situation, whereas it is easily done if the&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">--no-ff<\/code> flag was used.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Yes, it will create a few more (empty) commit objects, but the gain is much bigger that that cost.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Unfortunately, I have not found a way to make&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">--no-ff<\/code> the default behaviour of&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">git merge<\/code>yet, but it really should be.<\/p>\n<h3 style=\"font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; color: #333333; line-height: normal; padding: 0px; margin: 0px;\">Release branches<\/h3>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">May branch off from:&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code><br>\nMust merge back into:&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> and&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code><br>\nBranch naming convention:&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">release-*<\/code><\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Release branches support preparation of a new production release.&nbsp;They allow for last-minute dotting of i\u2019s and crossing t\u2019s. Furthermore, they allow for minor bug fixes and preparing meta-data for a release (version number, build dates, etc.). By doing all of this work on a release branch, the&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> branch is cleared to receive features for the next big release.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">The key moment to branch off a new release branch from&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> is when develop (almost) reflects the desired state of the new release.&nbsp;At least all features that are targeted for the release-to-be-built must be merged in to&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> at this point in time. All features targeted at future releases may not\u2014they must wait until after the release branch is branched off.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">It is exactly at the start of a release branch that the upcoming release gets assigned a version number\u2014not any earlier. Up until that moment, the&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> branch reflected changes for the \u201cnext release\u201d, but it is unclear whether that \u201cnext release\u201d will eventually become 0.3 or 1.0, until the release branch is started. That decision is made on the start of the release branch and is carried out by the project\u2019s rules on version number bumping.<\/p>\n<h4 style=\"font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; line-height: normal; font-size: medium; padding: 0px; margin: 0px;\">Creating a release branch<\/h4>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Release branches are created from the&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> branch. For example, say version 1.1.5 is the current production release and we have a big release coming up. The state of&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> is ready for the \u201cnext release\u201d and we have decided that this will become version 1.2 (rather than 1.1.6 or 2.0). So we branch off and give the release branch a name reflecting the new version number:<\/p>\n<pre style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; line-height: 1.4em; color: #222222; border-image: initial; display: table; border-bottom-right-radius: 12px; box-shadow: #cccccc 2px 3px 5px; -webkit-box-shadow: #cccccc 2px 3px 5px; overflow-x: hidden; overflow-y: hidden; border-width: 1px 1px 1px 5px; border-color: #f7a600; border-style: solid; padding: 10px 16px 10px 16px; margin: -10px 20px 20px 20px;\"><code class=\"language-console\" style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; display: block; max-width: 520px; overflow-x: visible; overflow-y: visible; padding: 0px; margin: 0px;\"><span class=\"gp\" style=\"color: #555555;\">$<\/span> git checkout -b release-1.2 develop <span class=\"go\" style=\"color: #888888;\">Switched to a new branch \"release-1.2\"<\/span> <span class=\"gp\" style=\"color: #555555;\">$<\/span> .\/bump-version.sh 1.2 <span class=\"go\" style=\"color: #888888;\">Files modified successfully, version bumped to 1.2.<\/span> <span class=\"gp\" style=\"color: #555555;\">$<\/span> git commit -a -m <span class=\"s2\" style=\"color: #bb8844;\">\"Bumped version number to 1.2\"<\/span> <span class=\"go\" style=\"color: #888888;\">[release-1.2 74d9424] Bumped version number to 1.2<\/span> <span class=\"go\" style=\"color: #888888;\">1 files changed, 1 insertions(+), 1 deletions(-)<\/span><\/code><\/pre>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">After creating a new branch and switching to it, we bump the version number. Here,&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">bump-version.sh<\/code> is a&nbsp;fictional&nbsp;shell script that changes some files in the working copy to reflect the new version. (This can of course be a manual change\u2014the point being that&nbsp;<em>some<\/em> files change.) Then, the bumped version number is committed.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">This new branch may exist there for a while, until the release may be rolled out definitely. During that time, bug fixes may be applied in this branch (rather than on the&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code>branch). Adding large new features here is strictly prohibited. They must be merged into<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code>, and therefore, wait for the next big release.<\/p>\n<h4 style=\"font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; line-height: normal; font-size: medium; padding: 0px; margin: 0px;\">Finishing a release branch<\/h4>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">When the state of the release branch is ready to become a real release, some actions need to be carried out. First, the release branch is merged into&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code> (since every commit on<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code> is a new release&nbsp;<em>by definition<\/em>, remember). Next, that commit on&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code> must be tagged for easy future reference to this historical version. Finally, the changes made on the release branch need to be merged back into&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code>, so that future releases also contain these bug fixes.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">The first two steps in Git:<\/p>\n<pre style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; line-height: 1.4em; color: #222222; border-image: initial; display: table; border-bottom-right-radius: 12px; box-shadow: #cccccc 2px 3px 5px; -webkit-box-shadow: #cccccc 2px 3px 5px; overflow-x: hidden; overflow-y: hidden; border-width: 1px 1px 1px 5px; border-color: #f7a600; border-style: solid; padding: 10px 16px 10px 16px; margin: -10px 20px 20px 20px;\"><code class=\"language-console\" style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; display: block; max-width: 520px; overflow-x: visible; overflow-y: visible; padding: 0px; margin: 0px;\"><span class=\"gp\" style=\"color: #555555;\">$<\/span> git checkout master <span class=\"go\" style=\"color: #888888;\">Switched to branch 'master'<\/span> <span class=\"gp\" style=\"color: #555555;\">$<\/span> git merge --no-ff release-1.2 <span class=\"go\" style=\"color: #888888;\">Merge made by recursive.<\/span> <span class=\"go\" style=\"color: #888888;\">(Summary of changes)<\/span> <span class=\"gp\" style=\"color: #555555;\">$<\/span> git tag -a 1.2<\/code><\/pre>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">The release is now done, and tagged for future reference.<br>\n<ins><strong>Edit:<\/strong> You might as well want to use the&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">-s<\/code> or&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">-u &lt;key&gt;<\/code> flags to sign your tag cryptographically.<\/ins><\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">To keep the changes made in the release branch, we need to merge those back into<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code>, though. In Git:<\/p>\n<pre style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; line-height: 1.4em; color: #222222; border-image: initial; display: table; border-bottom-right-radius: 12px; box-shadow: #cccccc 2px 3px 5px; -webkit-box-shadow: #cccccc 2px 3px 5px; overflow-x: hidden; overflow-y: hidden; border-width: 1px 1px 1px 5px; border-color: #f7a600; border-style: solid; padding: 10px 16px 10px 16px; margin: -10px 20px 20px 20px;\"><code class=\"language-console\" style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; display: block; max-width: 520px; overflow-x: visible; overflow-y: visible; padding: 0px; margin: 0px;\"><span class=\"gp\" style=\"color: #555555;\">$<\/span> git checkout develop <span class=\"go\" style=\"color: #888888;\">Switched to branch 'develop'<\/span> <span class=\"gp\" style=\"color: #555555;\">$<\/span> git merge --no-ff release-1.2 <span class=\"go\" style=\"color: #888888;\">Merge made by recursive.<\/span> <span class=\"go\" style=\"color: #888888;\">(Summary of changes)<\/span><\/code><\/pre>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">This step may well lead to a merge conflict (probably even, since we have changed the version number). If so, fix it and commit.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Now we are really done and the release branch may be removed, since we don\u2019t need it anymore:<\/p>\n<pre style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; line-height: 1.4em; color: #222222; border-image: initial; display: table; border-bottom-right-radius: 12px; box-shadow: #cccccc 2px 3px 5px; -webkit-box-shadow: #cccccc 2px 3px 5px; overflow-x: hidden; overflow-y: hidden; border-width: 1px 1px 1px 5px; border-color: #f7a600; border-style: solid; padding: 10px 16px 10px 16px; margin: -10px 20px 20px 20px;\"><code class=\"language-console\" style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; display: block; max-width: 520px; overflow-x: visible; overflow-y: visible; padding: 0px; margin: 0px;\"><span class=\"gp\" style=\"color: #555555;\">$<\/span> git branch -d release-1.2 <span class=\"go\" style=\"color: #888888;\">Deleted branch release-1.2 (was ff452fe).<\/span><\/code><\/pre>\n<h3 style=\"font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; color: #333333; line-height: normal; padding: 0px; margin: 0px;\">Hotfix branches<\/h3>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\"><img decoding=\"async\" class=\"right\" style=\"max-width: 580px; float: right; margin: 0px 0px 12px 12px; border: initial none initial;\" src=\"http:\/\/nvie.com\/img\/2010\/01\/hotfix-branches1.png\" border=\"0\"><\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">May branch off from:&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code><br>\nMust merge back into:&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> and&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code><br>\nBranch naming convention:&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">hotfix-*<\/code><\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Hotfix branches are very much like release branches in that they are also meant to prepare for a new production release, albeit unplanned. They arise from the necessity to act immediately upon an undesired state of a live production version. When a critical bug in a production version must be resolved immediately, a hotfix branch may be branched off from the corresponding tag on the master branch that marks the production version.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">The essence is that work of team members (on the&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> branch) can continue, while another person is preparing a quick production fix.<\/p>\n<h4 style=\"font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; line-height: normal; font-size: medium; padding: 0px; margin: 0px;\">Creating the hotfix branch<\/h4>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Hotfix branches are created from the&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code> branch. For example, say version 1.2 is the current production release running live and causing troubles due to a severe bug. But changes on&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> are yet unstable.&nbsp;We may then branch off a hotfix branch and start fixing the problem:<\/p>\n<pre style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; line-height: 1.4em; color: #222222; border-image: initial; display: table; border-bottom-right-radius: 12px; box-shadow: #cccccc 2px 3px 5px; -webkit-box-shadow: #cccccc 2px 3px 5px; overflow-x: hidden; overflow-y: hidden; border-width: 1px 1px 1px 5px; border-color: #f7a600; border-style: solid; padding: 10px 16px 10px 16px; margin: -10px 20px 20px 20px;\"><code class=\"language-console\" style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; display: block; max-width: 520px; overflow-x: visible; overflow-y: visible; padding: 0px; margin: 0px;\"><span class=\"gp\" style=\"color: #555555;\">$<\/span> git checkout -b hotfix-1.2.1 master <span class=\"go\" style=\"color: #888888;\">Switched to a new branch \"hotfix-1.2.1\"<\/span> <span class=\"gp\" style=\"color: #555555;\">$<\/span> .\/bump-version.sh 1.2.1 <span class=\"go\" style=\"color: #888888;\">Files modified successfully, version bumped to 1.2.1.<\/span> <span class=\"gp\" style=\"color: #555555;\">$<\/span> git commit -a -m <span class=\"s2\" style=\"color: #bb8844;\">\"Bumped version number to 1.2.1\"<\/span> <span class=\"go\" style=\"color: #888888;\">[hotfix-1.2.1 41e61bb] Bumped version number to 1.2.1<\/span> <span class=\"go\" style=\"color: #888888;\">1 files changed, 1 insertions(+), 1 deletions(-)<\/span><\/code><\/pre>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Don\u2019t forget to bump the version number after branching off!<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Then, fix the bug and commit the fix in one or more separate commits.<\/p>\n<pre style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; line-height: 1.4em; color: #222222; border-image: initial; display: table; border-bottom-right-radius: 12px; box-shadow: #cccccc 2px 3px 5px; -webkit-box-shadow: #cccccc 2px 3px 5px; overflow-x: hidden; overflow-y: hidden; border-width: 1px 1px 1px 5px; border-color: #f7a600; border-style: solid; padding: 10px 16px 10px 16px; margin: -10px 20px 20px 20px;\"><code class=\"language-console\" style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; display: block; max-width: 520px; overflow-x: visible; overflow-y: visible; padding: 0px; margin: 0px;\"><span class=\"gp\" style=\"color: #555555;\">$<\/span> git commit -m <span class=\"s2\" style=\"color: #bb8844;\">\"Fixed severe production problem\"<\/span> <span class=\"go\" style=\"color: #888888;\">[hotfix-1.2.1 abbe5d6] Fixed severe production problem<\/span> <span class=\"go\" style=\"color: #888888;\">5 files changed, 32 insertions(+), 17 deletions(-)<\/span><\/code><\/pre>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\"><strong>Finishing a hotfix branch<\/strong><\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">When finished, the bugfix needs to be merged back into&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code>, but also needs to be merged back into&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code>, in order to&nbsp;safeguard&nbsp;that the bugfix is included in the next release as well. This is completely similar to how release branches are finished.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">First, update&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">master<\/code> and tag the release.<\/p>\n<pre style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; line-height: 1.4em; color: #222222; border-image: initial; display: table; border-bottom-right-radius: 12px; box-shadow: #cccccc 2px 3px 5px; -webkit-box-shadow: #cccccc 2px 3px 5px; overflow-x: hidden; overflow-y: hidden; border-width: 1px 1px 1px 5px; border-color: #f7a600; border-style: solid; padding: 10px 16px 10px 16px; margin: -10px 20px 20px 20px;\"><code class=\"language-console\" style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; display: block; max-width: 520px; overflow-x: visible; overflow-y: visible; padding: 0px; margin: 0px;\"><span class=\"gp\" style=\"color: #555555;\">$<\/span> git checkout master <span class=\"go\" style=\"color: #888888;\">Switched to branch 'master'<\/span> <span class=\"gp\" style=\"color: #555555;\">$<\/span> git merge --no-ff hotfix-1.2.1 <span class=\"go\" style=\"color: #888888;\">Merge made by recursive.<\/span> <span class=\"go\" style=\"color: #888888;\">(Summary of changes)<\/span> <span class=\"gp\" style=\"color: #555555;\">$<\/span> git tag -a 1.2.1<\/code><\/pre>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\"><ins><strong>Edit:<\/strong> You might as well want to use the&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">-s<\/code> or&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">-u &lt;key&gt;<\/code> flags to sign your tag cryptographically.<\/ins><\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Next,&nbsp;include the bugfix in&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code>, too:<\/p>\n<pre style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; line-height: 1.4em; color: #222222; border-image: initial; display: table; border-bottom-right-radius: 12px; box-shadow: #cccccc 2px 3px 5px; -webkit-box-shadow: #cccccc 2px 3px 5px; overflow-x: hidden; overflow-y: hidden; border-width: 1px 1px 1px 5px; border-color: #f7a600; border-style: solid; padding: 10px 16px 10px 16px; margin: -10px 20px 20px 20px;\"><code class=\"language-console\" style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; display: block; max-width: 520px; overflow-x: visible; overflow-y: visible; padding: 0px; margin: 0px;\"><span class=\"gp\" style=\"color: #555555;\">$<\/span> git checkout develop <span class=\"go\" style=\"color: #888888;\">Switched to branch 'develop'<\/span> <span class=\"gp\" style=\"color: #555555;\">$<\/span> git merge --no-ff hotfix-1.2.1 <span class=\"go\" style=\"color: #888888;\">Merge made by recursive.<\/span> <span class=\"go\" style=\"color: #888888;\">(Summary of changes)<\/span><\/code><\/pre>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">The one exception to the rule here is that,&nbsp;<strong>when a release branch currently exists, the hotfix changes need to be merged into that release branch, instead of<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code><\/strong>. Back-merging the bugfix into the release branch will eventually result in the bugfix being merged into&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> too, when the release branch is finished. (If work in<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> immediately requires this bugfix and cannot wait for the release branch to be finished, you may safely merge the bugfix into&nbsp;<code style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;\">develop<\/code> now already as well.)<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">Finally, remove the temporary branch:<\/p>\n<pre style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; line-height: 1.4em; color: #222222; border-image: initial; display: table; border-bottom-right-radius: 12px; box-shadow: #cccccc 2px 3px 5px; -webkit-box-shadow: #cccccc 2px 3px 5px; overflow-x: hidden; overflow-y: hidden; border-width: 1px 1px 1px 5px; border-color: #f7a600; border-style: solid; padding: 10px 16px 10px 16px; margin: -10px 20px 20px 20px;\"><code class=\"language-console\" style=\"font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt; display: block; max-width: 520px; overflow-x: visible; overflow-y: visible; padding: 0px; margin: 0px;\"><span class=\"gp\" style=\"color: #555555;\">$<\/span> git branch -d hotfix-1.2.1 <span class=\"go\" style=\"color: #888888;\">Deleted branch hotfix-1.2.1 (was abbe5d6).<\/span><\/code><\/pre>\n<h2 style=\"font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; line-height: normal; padding: 0px; margin: 24px 0px 12px 0px;\">Summary<\/h2>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">While there is nothing really shocking new to this branching model, the \u201cbig picture\u201d figure that this post began with has turned out to be tremendously useful in our projects. It forms an elegant mental model that is easy to comprehend and allows team members to develop a shared understanding of the branching and releasing processes.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\">A high-quality&nbsp;<span class=\"caps\">PDF<\/span> version of the figure is provided here. Go ahead and hang it on the wall for quick reference at any time.<\/p>\n<p style=\"font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;\"><ins><strong>Update:<\/strong> And for anyone who requested it: here\u2019s the&nbsp;<a style=\"color: #3270ae;\" href=\"http:\/\/github.com\/downloads\/nvie\/gitflow\/Git-branching-model-src.key.zip\" target=\"_blank\" rel=\"noopener\">gitflow-model.src.key<\/a> of the main diagram image (Apple Keynote).<\/ins><\/p>\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_16439\"><figure class=\"wp-block-embed wp-block-embed-youtube is-type-video is-provider-youtube epyt-figure\"><div class=\"wp-block-embed__wrapper\"><iframe loading=\"lazy\"  id=\"_ytid_38381\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_16439\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><\/div><\/figure><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>I was reading article and thought to repost here. It focuses around&nbsp;Git as the tool for the versioning of all of our source code. Why git? For a thorough discussion on the pros and cons of Git compared to centralized source code control systems,&nbsp;see the web. There are plenty of flame wars going on there&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":3855,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[38],"tags":[2213,160,2607,2217,2613,2605,2610,2608,2609,2612,545,1692,593,2606,2611,213],"class_list":["post-309","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","tag-branching","tag-git","tag-git-branches","tag-git-branching","tag-git-branching-guide","tag-git-branching-model","tag-git-branching-model-guide","tag-git-branching-model-tutorial","tag-git-branching-model-workflow","tag-git-branching-tutorial","tag-how","tag-model","tag-process","tag-successful-git-branching-model","tag-successful-git-branching-tutorial","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=309"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/309\/revisions"}],"predecessor-version":[{"id":25860,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/309\/revisions\/25860"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/3855"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}