<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Branching Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/branching/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/branching/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 27 Feb 2021 09:52:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Best Branching and Merging strategies in Gerrit</title>
		<link>https://www.scmgalaxy.com/tutorials/best-branching-and-merging-strategies-in-gerrit/</link>
					<comments>https://www.scmgalaxy.com/tutorials/best-branching-and-merging-strategies-in-gerrit/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Wed, 22 Aug 2018 14:09:36 +0000</pubDate>
				<category><![CDATA[Gerrit]]></category>
		<category><![CDATA[Best]]></category>
		<category><![CDATA[Branching]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Merging]]></category>
		<category><![CDATA[strategies]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5242</guid>

					<description><![CDATA[<p>Best Branching and Merging strategies in Gerrit Step 1 &#8211; First Lets read this article about Best Branching and Merging [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/best-branching-and-merging-strategies-in-gerrit/">Best Branching and Merging strategies in Gerrit</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-5269" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2018/08/gerrit-1.png" alt="" width="600" height="350" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2018/08/gerrit-1.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2018/08/gerrit-1-300x175.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p><strong>Best Branching and Merging strategies in Gerrit</strong></p>
<p><strong>Step 1 &#8211; First Lets read this article about Best Branching and Merging strategies in git</strong></p>
<blockquote class="wp-embedded-content" data-secret="R7GR5d9ayw"><p><a href="https://www.scmgalaxy.com/tutorials/best-branching-and-merging-strategies-in-git/">Best Branching and Merging strategies in git</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Best Branching and Merging strategies in git&#8221; &#8212; scmGalaxy" src="https://www.scmgalaxy.com/tutorials/best-branching-and-merging-strategies-in-git/embed/#?secret=cMx479AkuJ#?secret=R7GR5d9ayw" data-secret="R7GR5d9ayw" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>Step 2 &#8211; Now Lets learn the Gerrit Merge Types</strong><br />
https://nofluffjuststuff.com/magazine/2016/04/understanding_and_applying_gerrit_part_3_gerrit_submit_types_and_git_review</p>
<p><strong>Step 3 &#8211; Time to Learn the Types of Submit in Gerrit</strong><br />
https://gerrit-review.googlesource.com/Documentation/project-configuration.html</p>
<p><strong>Step 4 &#8211; Finally, You must read the recommendations below</strong><br />
https://hyperledger-fabric.readthedocs.io/en/release-1.2/Gerrit/best-practices.html</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/best-branching-and-merging-strategies-in-gerrit/">Best Branching and Merging strategies in Gerrit</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/best-branching-and-merging-strategies-in-gerrit/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Best Branching and Merging strategies in git</title>
		<link>https://www.scmgalaxy.com/tutorials/best-branching-and-merging-strategies-in-git/</link>
					<comments>https://www.scmgalaxy.com/tutorials/best-branching-and-merging-strategies-in-git/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Wed, 22 Aug 2018 13:51:49 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Best]]></category>
		<category><![CDATA[branch]]></category>
		<category><![CDATA[Branching]]></category>
		<category><![CDATA[Gerrit]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Merge]]></category>
		<category><![CDATA[Merging]]></category>
		<category><![CDATA[strategies]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5233</guid>

					<description><![CDATA[<p>Best Branching and Merging strategies in git Step 1 &#8211; First you need to learn the needs of branches. This [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/best-branching-and-merging-strategies-in-git/">Best Branching and Merging strategies in git</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="alignnone size-full wp-image-5275" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2018/08/git.png" alt="" width="600" height="350" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2018/08/git.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2018/08/git-300x175.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p><strong>Best Branching and Merging strategies in git</strong></p>
<p><strong>Step 1 &#8211; First you need to learn the needs of branches. This is very good read.</strong></p>
<ul>
<li>https://docs.microsoft.com/en-us/vsts/repos/tfvc/branching-strategies-with-tfvc?view=vsts</li>
</ul>
<p><strong>Step 2 &#8211; Now time has come to Learn best branching model in Git.</strong></p>
<ul>
<li>https://buddy.works/blog/5-types-of-git-workflows</li>
<li>https://hackernoon.com/a-branching-and-releasing-strategy-that-fits-github-flow-be1b6c48eca2</li>
<li>https://nvie.com/posts/a-successful-git-branching-model/</li>
</ul>
<p><strong>Step 3 &#8211; Now, Lets understand, what is the kind of merges we have in Git?</strong></p>
<ul>
<li>https://www.atlassian.com/git/tutorials/using-branches/git-merge</li>
<li>https://git-scm.com/docs/merge-strategies</li>
<li>https://stackoverflow.com/questions/366860/when-would-you-use-the-different-git-merge-strategies</li>
</ul>
<p><strong>Step 4 &#8211; Are you still having a questions, Please post in the comment section.</strong></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/best-branching-and-merging-strategies-in-git/">Best Branching and Merging strategies in git</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/best-branching-and-merging-strategies-in-git/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Important Configuration Definitions</title>
		<link>https://www.scmgalaxy.com/tutorials/important-configuration-definitions/</link>
					<comments>https://www.scmgalaxy.com/tutorials/important-configuration-definitions/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Sat, 06 Jan 2018 10:24:24 +0000</pubDate>
				<category><![CDATA[Concept & Definition]]></category>
		<category><![CDATA[Branching]]></category>
		<category><![CDATA[Build]]></category>
		<category><![CDATA[Codeline]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Configuration Definitions]]></category>
		<category><![CDATA[Milestone]]></category>
		<category><![CDATA[Private build]]></category>
		<category><![CDATA[Snapshot]]></category>
		<category><![CDATA[source code]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=4472</guid>

					<description><![CDATA[<p>Source code— Files written in high-level languages such as C# that need to be compiled (for example, foo.cs). Source(s)— All [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/important-configuration-definitions/">Important Configuration Definitions</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<ul>
<li><strong>Source code</strong>— Files written in high-level languages such as C# that need to be compiled (for example, foo.cs).</li>
<li><strong>Source(s)</strong>— All the files involved in building a product (for example, C, CPP, VB, DOC, HTM, H, and CS). This term is used mostly as a catch-all phrase that is specific not only to source code files but to all the files that are stored in version tracking systems.</li>
<li><strong>Codeline</strong>— A tree or branch of code that has a specific purpose, such as the mainline, release line, or hotfix line that grows collectively.</li>
<li><strong>Mainline or trunk </strong>(&#8220;The Golden Tree&#8221;)— <a id="iddle1037" name="iddle1037"></a><a id="iddle1107" name="iddle1107"></a><a id="iddle1252" name="iddle1252"></a><a id="iddle1266" name="iddle1266"></a><a id="iddle1365" name="iddle1365"></a><a id="iddle1424" name="iddle1424"></a><a id="iddle1503" name="iddle1503"></a><a id="iddle1526" name="iddle1526"></a><a id="iddle1570" name="iddle1570"></a><a id="iddle1624" name="iddle1624"></a><a id="iddle1744" name="iddle1744"></a>The main codeline of the product that contains the entire source code, document files, and anything else necessary to build and release the complete product.</li>
<li><strong>Snapshot</strong>— A specific point in time in which the sources and build are captured and stored, usually on a release or build machine.</li>
<li><strong>Milestone</strong>— A measurement of work items that includes a specified number of deliverables for a given project scheduled for a specified amount of time that are delivered, reviewed, and fixed to meet a high quality bar. The purpose of a milestone is to understand what is done, what is left to do, and how that fits with the given schedule and resources. To do this, the team must complete a portion of the project and review it to understand where the project is in the schedule and to reconcile what is not done with the rest of the schedule. A milestone is the best way to know how much time a portion of the project will take.</li>
<li><strong>Code freeze</strong>— A period when the automatic updates and build processes are stopped to take the final check-ins at a milestone.</li>
<li><strong>Public build</strong>— A build using the sources from the mainline or trunk.</li>
<li><strong>Private build </strong>(also referred to as a sandbox build)— A build using a project component tree to build more specific pieces of the product. This is usually done prior to checking in the code to the mainline.</li>
<li><strong>Branching</strong>— A superset of files off the mainline taken at a certain time (snapshot) that contains new developments for hotfixes or new versions. Each branch continues to grow independently or dependently on the mainline.</li>
<li><strong>Forking</strong>— Cloning a source tree to allow controlled changes on one tree while allowing the other tree to grow at its own rate. The difference between forking and branching is that forking involves two trees, whereas branching involves just one. It is also important to note that forking or cloning makes a copy (snapshot) of the tree and does not share the history between the two trees, whereas branching does share the history.</li>
<li><strong>Virtual Build Labs (VBLs)</strong>— A Virtual Build Lab is a build lab that is owned by a specific component or project team. The owner is responsible for propagating and integrating his code into the mainline or public build. Each VBL performs full builds and installable releases from the code in its source lines and the mainline. Although <a id="iddle1005" name="iddle1005"></a><a id="iddle1021" name="iddle1021"></a><a id="iddle1035" name="iddle1035"></a><a id="iddle1239" name="iddle1239"></a><a id="iddle1253" name="iddle1253"></a><a id="iddle1559" name="iddle1559"></a><a id="iddle1561" name="iddle1561"></a><a id="iddle1582" name="iddle1582"></a><a id="iddle1640" name="iddle1640"></a><a id="iddle1835" name="iddle1835"></a>the term virtual is used in the name of the labs, don&#8217;t confuse it with Virtual PC or Virtual Machines because the labs are real physical rooms and computer boxes. It is not recommended that you use Virtual software for build machines except possibly for an occasional one-off or hotfix build. , &#8220;The Build Lab and Personnel.&#8221; There is usually a hierarchy of VBLs so that code &#8220;rolls up&#8221; to the mainline or trunk. For example, let&#8217;s say that you have a mainline, Project A is a branch off of the mainline, and Developer 1 has a branch off the project branch. Developer 1 has several branches off his branch, with each branch representing a different component of the product. If he wants to integrate one of his branches into main, he should first merge his changes with all the levels above the branch to make sure he gets all the changes. Alternatively, he can just roll the changes into main, which sits higher in the hierarchy. This will become clearer in the next couple of pages.</li>
<li><strong>Reverse integration (RI)</strong>— The process of moving sources from one branch or tree to another that is higher in the VBL hierarchy.</li>
<li><strong>Forward integration (FI)</strong>— The process of moving sources from one branch or tree to another that is lower in the VBL hierarchy.</li>
<li><strong>Buddy build</strong>— A build performed on a machine other than the machine that the developer originally made changes on. This is done to validate the list of changed files so that there are no unintended consequences to the change in the mainline build.</li>
</ul>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/important-configuration-definitions/">Important Configuration Definitions</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/important-configuration-definitions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>GIT Tutorial &#8211; Branching and Merging</title>
		<link>https://www.scmgalaxy.com/tutorials/git-tutorial-branching-and-merging/</link>
					<comments>https://www.scmgalaxy.com/tutorials/git-tutorial-branching-and-merging/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Wed, 04 Jun 2014 15:22:54 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Branching]]></category>
		<category><![CDATA[Branching and Merging in Git]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Git Branching]]></category>
		<category><![CDATA[Git Branching and Merging]]></category>
		<category><![CDATA[Git Branching and Merging Guide]]></category>
		<category><![CDATA[Git Branching and Merging Tutorial]]></category>
		<category><![CDATA[Git Guide]]></category>
		<category><![CDATA[Git Merging]]></category>
		<category><![CDATA[Git Reference]]></category>
		<category><![CDATA[Git Tutorial]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[Merging]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2014/06/04/git-tutorial-branching-and-merging/</guid>

					<description><![CDATA[<p>The post <a href="https://www.scmgalaxy.com/tutorials/git-tutorial-branching-and-merging/">GIT Tutorial &#8211; Branching and Merging</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3709 alignleft" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/06/git-tutorial.png" alt="git-branching-and-merging-tutorial" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/06/git-tutorial.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/06/git-tutorial-300x200.png 300w" sizes="auto, (max-width: 600px) 100vw, 600px" /></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/git-tutorial-branching-and-merging/">GIT Tutorial &#8211; Branching and Merging</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/git-tutorial-branching-and-merging/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A Successful Git branching model &#124; Git branching model Guide</title>
		<link>https://www.scmgalaxy.com/tutorials/a-successful-git-branching-model/</link>
					<comments>https://www.scmgalaxy.com/tutorials/a-successful-git-branching-model/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Sat, 07 Jan 2012 23:46:31 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Branching]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Git branches]]></category>
		<category><![CDATA[Git Branching]]></category>
		<category><![CDATA[Git branching Guide]]></category>
		<category><![CDATA[Git branching model]]></category>
		<category><![CDATA[Git branching model Guide]]></category>
		<category><![CDATA[Git branching model Tutorial]]></category>
		<category><![CDATA[Git branching model workflow]]></category>
		<category><![CDATA[Git branching Tutorial]]></category>
		<category><![CDATA[How]]></category>
		<category><![CDATA[Model]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Successful Git branching model]]></category>
		<category><![CDATA[Successful Git branching Tutorial]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2012/01/07/a-successful-git-branching-model/</guid>

					<description><![CDATA[<p>I was reading article and thought to repost here. It focuses around Git as the tool for the versioning of all [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/a-successful-git-branching-model/">A Successful Git branching model | Git branching model Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3855 aligncenter" src="https://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.scmgalaxy.com/tutorials/wp-content/uploads/2012/01/git-branching-mode.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2012/01/git-branching-mode-300x200.png 300w" sizes="auto, (max-width: 600px) 100vw, 600px" /></p>
<p>I was reading article and thought to repost here.</p>
<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>
<p style="font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;">It focuses around <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>
<h2 style="font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; line-height: normal; padding: 0px; margin: 24px 0px 12px 0px;">Why git?</h2>
<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, <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 <span class="caps">CVS</span>/Subversion world I came from, merging/branching has always been considered a bit scary (“beware of merge conflicts, they bite you!”) and something you only do every once in a while.</p>
<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 <em>daily</em> workflow, really. For example, in <span class="caps">CVS</span>/Subversion <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 <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’s already covered in chapter 3 (basics).</p>
<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>
<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’s head onto the development model. The model that I’m 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>
<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>
<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 “truth” repo. Note that this repo is only <em>considered</em> to be the central one (since Git is a <span class="caps">DVCS</span>, there is no such thing as a central repo at a technical level). We will refer to this repo as <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>
<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>
<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 <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>
<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 <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">bob</code>, pointing to Bob’s repository, and vice versa.</p>
<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>
<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>
<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. The central repo holds two main branches with an infinite lifetime:</p>
<ul style="font-family: Georgia, Arial, sans-serif; line-height: normal; font-size: medium; margin: -12px 0px 20px 0px;">
<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>
<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>
</ul>
<p style="font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;">The <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">master</code> branch at <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">origin</code> should be familiar to every Git user. Parallel to the <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">master</code> branch, another branch exists called <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">develop</code>.</p>
<p style="font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;">We consider <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 <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>
<p style="font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;">We consider <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 <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 “integration branch”. This is where any automatic nightly builds are built from.</p>
<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 <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 <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>
<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 <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">master</code>, this is a new production release <em>by definition</em>. 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 <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">master</code>.</p>
<h2 style="font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; line-height: normal; padding: 0px; margin: 24px 0px 12px 0px;">Supporting branches</h2>
<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 <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">master</code> and <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>
<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>
<ul style="font-family: Georgia, Arial, sans-serif; line-height: normal; font-size: medium; margin: -12px 0px 20px 0px;">
<li style="font-size: 15px; line-height: 20px; list-style-type: square;">Feature branches</li>
<li style="font-size: 15px; line-height: 20px; list-style-type: square;">Release branches</li>
<li style="font-size: 15px; line-height: 20px; list-style-type: square;">Hotfix branches</li>
</ul>
<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>
<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 “special” from a technical perspective. The branch types are categorized by how we <em>use</em> them. They are of course plain old Git branches.</p>
<h3 style="font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; color: #333333; line-height: normal; padding: 0px; margin: 0px;">Feature branches</h3>
<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>
<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: <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">develop</code><br />
Must merge back into: <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">develop</code><br />
Branch naming convention: anything except <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">master</code>, <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 <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">hotfix-*</code></p>
<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 <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>
<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>
<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>
<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 <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">develop</code> branch.</p>
<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>
<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>
<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 <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>
<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>
<p style="font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;">The <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>
<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>
<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—you 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 <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">--no-ff</code> flag was used.</p>
<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>
<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 <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">--no-ff</code> the default behaviour of <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">git merge</code>yet, but it really should be.</p>
<h3 style="font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; color: #333333; line-height: normal; padding: 0px; margin: 0px;">Release branches</h3>
<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: <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">develop</code><br />
Must merge back into: <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">develop</code> and <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">master</code><br />
Branch naming convention: <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">release-*</code></p>
<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. They allow for last-minute dotting of i’s and crossing t’s. 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 <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>
<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 <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. At least all features that are targeted for the release-to-be-built must be merged in to <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—they must wait until after the release branch is branched off.</p>
<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—not any earlier. Up until that moment, the <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">develop</code> branch reflected changes for the “next release”, but it is unclear whether that “next release” 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’s rules on version number bumping.</p>
<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>
<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 <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 <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">develop</code> is ready for the “next release” 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>
<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>
<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, <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">bump-version.sh</code> is a fictional shell script that changes some files in the working copy to reflect the new version. (This can of course be a manual change—the point being that <em>some</em> files change.) Then, the bumped version number is committed.</p>
<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 <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>
<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>
<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 <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 <em>by definition</em>, remember). Next, that commit on <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 <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>
<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>
<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>
<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 />
<ins><strong>Edit:</strong> You might as well want to use the <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">-s</code> or <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>
<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>
<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>
<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>
<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’t need it anymore:</p>
<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>
<h3 style="font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; color: #333333; line-height: normal; padding: 0px; margin: 0px;">Hotfix branches</h3>
<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>
<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: <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">master</code><br />
Must merge back into: <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">develop</code> and <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">master</code><br />
Branch naming convention: <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">hotfix-*</code></p>
<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>
<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 <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>
<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>
<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 <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 <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">develop</code> are yet unstable. We may then branch off a hotfix branch and start fixing the problem:</p>
<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>
<p style="font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;">Don’t forget to bump the version number after branching off!</p>
<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>
<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>
<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>
<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 <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">master</code>, but also needs to be merged back into <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">develop</code>, in order to safeguard that the bugfix is included in the next release as well. This is completely similar to how release branches are finished.</p>
<p style="font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;">First, update <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">master</code> and tag the release.</p>
<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>
<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 <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">-s</code> or <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>
<p style="font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;">Next, include the bugfix in <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">develop</code>, too:</p>
<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>
<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, <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 <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 <code style="font-family: 'Droid Sans Mono', 'Courier New', monospace !important; font-size: 9pt;">develop</code> now already as well.)</p>
<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>
<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>
<h2 style="font-family: 'Graublau Web', Helvetica, sans-serif; clear: both; line-height: normal; padding: 0px; margin: 24px 0px 12px 0px;">Summary</h2>
<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 “big picture” 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>
<p style="font-size: 15px; line-height: 20px; font-family: Georgia, Arial, sans-serif; padding: 0px; margin: 10px 0px 20px 0px;">A high-quality <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>
<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’s the <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>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/a-successful-git-branching-model/">A Successful Git branching model | Git branching model Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/a-successful-git-branching-model/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Branching and Merging Best Practices &#124; Branching and Merging Guide</title>
		<link>https://www.scmgalaxy.com/tutorials/branching-and-merging-practices/</link>
					<comments>https://www.scmgalaxy.com/tutorials/branching-and-merging-practices/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Tue, 22 Feb 2011 06:48:46 +0000</pubDate>
				<category><![CDATA[Concept & Definition]]></category>
		<category><![CDATA[Best]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[branch]]></category>
		<category><![CDATA[Branching]]></category>
		<category><![CDATA[Branching and Merging]]></category>
		<category><![CDATA[Branching and Merging Best Practices]]></category>
		<category><![CDATA[Branching and Merging Good Practices]]></category>
		<category><![CDATA[Branching and Merging Guide]]></category>
		<category><![CDATA[Branching and Merging Guidelines]]></category>
		<category><![CDATA[Branching and Merging Learning Resources]]></category>
		<category><![CDATA[Branching and Merging References]]></category>
		<category><![CDATA[Branching and Merging Tutorials]]></category>
		<category><![CDATA[Branching Patterns]]></category>
		<category><![CDATA[Branching Strategies]]></category>
		<category><![CDATA[Good Practices]]></category>
		<category><![CDATA[Merge]]></category>
		<category><![CDATA[Merging]]></category>
		<category><![CDATA[Practices]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2011/02/22/branching-and-merging-practices/</guid>

					<description><![CDATA[<p>Branching and Merging Practices Branching and Merging Practices from Rajesh Kumar</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/branching-and-merging-practices/">Branching and Merging Best Practices | Branching and Merging Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3890" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2011/02/branching-and-merging.png" alt="branching-and-merging" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2011/02/branching-and-merging.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2011/02/branching-and-merging-300x200.png 300w" sizes="auto, (max-width: 600px) 100vw, 600px" /></h2>
<h2><strong>Branching and Merging Practices</strong></h2>
<h2><iframe loading="lazy" style="border: 1px solid #CCC; border-width: 1px; margin-bottom: 5px; max-width: 100%;" src="//www.slideshare.net/slideshow/embed_code/key/nhN1p3CFUc9RyN" width="595" height="485" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen="allowfullscreen"> </iframe></h2>
<div style="margin-bottom: 5px;"><strong> <a title="Branching and Merging Practices " href="//www.slideshare.net/rajeshatbuzz/branching-and-merging-practices" target="_blank" rel="noopener">Branching and Merging Practices </a> </strong> from <strong><a href="https://www.slideshare.net/rajeshatbuzz" target="_blank" rel="noopener">Rajesh Kumar</a></strong></div>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/branching-and-merging-practices/">Branching and Merging Best Practices | Branching and Merging Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/branching-and-merging-practices/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
