<?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>srever Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/srever/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Thu, 04 Apr 2019 03:41:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.13</generator>
	<item>
		<title>Introduction to the Git Branches</title>
		<link>https://www.osradar.com/introduction-to-the-git-branches/</link>
					<comments>https://www.osradar.com/introduction-to-the-git-branches/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Thu, 04 Apr 2019 03:40:54 +0000</pubDate>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[srever]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=11670</guid>

					<description><![CDATA[<p>We talked about Git earlier. Git is an open source program used for version control of the source code. In general, we can say that Git is perhaps the best in its area. It has a lot of community support, its learning is really easy and it has an unmatched performance. In addition to all [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/introduction-to-the-git-branches/">Introduction to the Git Branches</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>We talked about Git earlier. Git is an open source program used for version control of the source code. In general, we can say that Git is perhaps the best in its area. It has a lot of community support, its learning is really easy and it has an unmatched performance. In addition to all this is open soource and is available for almost all current operating systems. However, Git&#8217;s true power lies in the development branches that make it very versatile and tidy. Therefore, in this post, we will outline an introduction to the Git branches.</p>
<h2>The Git branches</h2>
<p>Today, any version control program must know how to implement development branches. It is understood by a development branch to a timeline of the code independent of the main branch. For example, we can create a master branch and then an unstable call. Where in the unstable branch we can go incorporating all the characteristics and code that we want without affecting all the work of the main branch. So with this, there is an independence of the code and allows us to make regressions without any problems.</p>
<p>Normally, developers do not incorporate all the features into the source code at once. If they do not take a solid stable base and start creating branches of developments whenever they need it, then they can always have the original code without errors.</p>
<p>So, let us start.</p>
<h2>The master branch: Initializing the project</h2>
<p>First, you need to install Git. For this, you have two articles on our site that will help you to do it without any problem.</p>
<p>If you use Debian 9 <a href="https://www.osradar.com/how-to-install-the-latest-version-of-git-in-debian-9/">this</a> article is for you.</p>
<p>Or, if you are using Ubuntu, then <a href="https://www.osradar.com/how-to-install-git-on-ubuntu-18-04-linux-mint-19/">this</a> is the right.</p>
<p>Then, create a new folder for the project.</p>
<pre>:~$ mkdir program1</pre>
<p>Next, init the git project with this command:</p>
<pre>:~$ git init</pre>
<figure id="attachment_11671" aria-describedby="caption-attachment-11671" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-11671" src="https://www.osradar.com/wp-content/uploads/2019/03/1-16.png" alt="1.- Init the git project" width="768" height="167" srcset="https://www.osradar.com/wp-content/uploads/2019/03/1-16.png 768w, https://www.osradar.com/wp-content/uploads/2019/03/1-16-300x65.png 300w, https://www.osradar.com/wp-content/uploads/2019/03/1-16-696x151.png 696w" sizes="(max-width: 768px) 100vw, 768px" /><figcaption id="caption-attachment-11671" class="wp-caption-text">1.- Init the git project</figcaption></figure>
<p>At this moment, our project has already been started and we can start working. However, it is necessary to make the first commit to start using the development branches. So, let&#8217;s get started.</p>
<pre>:~$ cd program1 &amp;&amp; touch README LICENSE
:~$ git add README LICENSE
:~$ git commit -m "Initial commit"</pre>
<figure id="attachment_11672" aria-describedby="caption-attachment-11672" style="width: 804px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-11672" src="https://www.osradar.com/wp-content/uploads/2019/03/2-16.png" alt="2.- The initial commit" width="804" height="431" srcset="https://www.osradar.com/wp-content/uploads/2019/03/2-16.png 804w, https://www.osradar.com/wp-content/uploads/2019/03/2-16-300x161.png 300w, https://www.osradar.com/wp-content/uploads/2019/03/2-16-768x412.png 768w, https://www.osradar.com/wp-content/uploads/2019/03/2-16-696x373.png 696w, https://www.osradar.com/wp-content/uploads/2019/03/2-16-783x420.png 783w" sizes="(max-width: 804px) 100vw, 804px" /><figcaption id="caption-attachment-11672" class="wp-caption-text">2.- The initial commit</figcaption></figure>
<h2>First steps using the Git Branches</h2>
<p>Now, the first development branch, the master, has been implicitly created. Where all the bulk of our project goes. If you want to show all the development branches that are on a project, run the following command:</p>
<pre>:~$ git branch</pre>
<figure id="attachment_11673" aria-describedby="caption-attachment-11673" style="width: 835px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-11673" src="https://www.osradar.com/wp-content/uploads/2019/03/3-15.png" alt="3.- show the git branches" width="835" height="170" srcset="https://www.osradar.com/wp-content/uploads/2019/03/3-15.png 835w, https://www.osradar.com/wp-content/uploads/2019/03/3-15-300x61.png 300w, https://www.osradar.com/wp-content/uploads/2019/03/3-15-768x156.png 768w, https://www.osradar.com/wp-content/uploads/2019/03/3-15-696x142.png 696w" sizes="(max-width: 835px) 100vw, 835px" /><figcaption id="caption-attachment-11673" class="wp-caption-text">3.- show the git branches</figcaption></figure>
<p>And to create a new branch, use the following command:</p>
<pre>:~$ git branch new_brach</pre>
<p>Now the branch is created but you need to tell Git we are going to work with it. In other words, you have to change the development branch.</p>
<pre>:~$ git checkout thebranch</pre>
<figure id="attachment_11674" aria-describedby="caption-attachment-11674" style="width: 872px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-11674" src="https://www.osradar.com/wp-content/uploads/2019/03/4-11.png" alt="4.- Change the branch" width="872" height="209" srcset="https://www.osradar.com/wp-content/uploads/2019/03/4-11.png 872w, https://www.osradar.com/wp-content/uploads/2019/03/4-11-300x72.png 300w, https://www.osradar.com/wp-content/uploads/2019/03/4-11-768x184.png 768w, https://www.osradar.com/wp-content/uploads/2019/03/4-11-696x167.png 696w" sizes="(max-width: 872px) 100vw, 872px" /><figcaption id="caption-attachment-11674" class="wp-caption-text">4.- Change the branch</figcaption></figure>
<p>Now, you can work normally on that development branch and it will not affect the main or master branch. Of course, there comes a point where the changes are already mature and it is necessary to join them with another branch. To do this, switch to the master branch and run:</p>
<pre>:~$ git checkout master
:~$ git merge thebranch</pre>
<figure id="attachment_11675" aria-describedby="caption-attachment-11675" style="width: 811px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-11675" src="https://www.osradar.com/wp-content/uploads/2019/03/5-8.png" alt="5.- Using merge" width="811" height="162" srcset="https://www.osradar.com/wp-content/uploads/2019/03/5-8.png 811w, https://www.osradar.com/wp-content/uploads/2019/03/5-8-300x60.png 300w, https://www.osradar.com/wp-content/uploads/2019/03/5-8-768x153.png 768w, https://www.osradar.com/wp-content/uploads/2019/03/5-8-696x139.png 696w" sizes="(max-width: 811px) 100vw, 811px" /><figcaption id="caption-attachment-11675" class="wp-caption-text">5.- Using merge</figcaption></figure>
<p>So, these are the basic of git branches. Create, changes and merge.</p>
<h2>Conclusion</h2>
<p>With this post, we don&#8217;t expect you to be an expert in Git branches but it does serve as a small introduction to the subject. Of course you can also use <a href="https://www.osradar.com/some-graphical-clients-for-git/" target="_blank" rel="noopener noreferrer">Git with other applications</a> that provide a graphical interface like <a href="https://www.gitkraken.com/" target="_blank" rel="noopener noreferrer">GitKraken</a>.</p>
<p>So share this post with your friends.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/introduction-to-the-git-branches/">Introduction to the Git Branches</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/introduction-to-the-git-branches/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
