<?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>git repository manage &#8211; Sibeesh Passion</title>
	<atom:link href="https://www.sibeeshpassion.com/tag/git-repository-manage/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Mon, 09 Mar 2020 10:15:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>git repository manage &#8211; Sibeesh Passion</title>
	<link>https://www.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Move Git Repositories From One to Other Organization in Azure DevOps</title>
		<link>https://www.sibeeshpassion.com/move-git-repositories-from-one-to-other-organization-in-azure-devops/</link>
					<comments>https://www.sibeeshpassion.com/move-git-repositories-from-one-to-other-organization-in-azure-devops/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Fri, 06 Mar 2020 14:49:50 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[azure devops]]></category>
		<category><![CDATA[Azure DevOps]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git repository manage]]></category>
		<category><![CDATA[move git repository to other]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14033</guid>

					<description><![CDATA[[toc] Introduction For this topic, I strongly believe that there is no need for an introduction as you already know what is Git and Azure DevOps, and I am guessing that you need to move your codebase or repositories from one of your organization to another. That is the reason why you are here. I believe that there is no direct way of achieving this, there may be some paid tools which do the tricks, but I didn&#8217;t want to pay anything for this small requirement. So let&#8217;s just see how I achieved this. Trust me this is not a [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>[toc]</p>



<h2 class="wp-block-heading">Introduction</h2>



<p>For this topic, I strongly believe that there is no need for an introduction as you already know what is Git and Azure DevOps, and I am guessing that you need to move your codebase or repositories from one of your organization to another. That is the reason why you are here. I believe that there is no direct way of achieving this, there may be some paid tools which do the tricks, but I didn&#8217;t want to pay anything for this small requirement. So let&#8217;s just see how I achieved this. Trust me this is not a tough task as it sounds. </p>



<h2 class="wp-block-heading">Background</h2>



<p>I was working with a project and my customer wanted to move the repositories to their Azure DevOps from ours. So before I do it directly with their DevOps, I wanted to try this out. So I created my own Azure DevOps and moved a sample repository to there from my company Azure DevOps. </p>



<h2 class="wp-block-heading">Move Repositories to Another Organization&#8217;s DevOps</h2>



<h3 class="wp-block-heading">Add a User to Both Organization</h3>



<p>To start doing this process, you should add a user to both projects. I created a sample user (tester@njanorumalayali.com) and assign the contributor access for the two repositories. If you don&#8217;t have permission to do so, please contact your project administrator and get it done. Once that is done, you can download all the codes from your Source Organization repository. To do that it is a good idea to use an SSH connection. </p>



<h3 class="wp-block-heading">Configure SSH Key</h3>



<p>To create one Generate the RSA key pair by running the <strong>ssh-keygen</strong> command. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img fetchpriority="high" decoding="async" width="1024" height="709" src="https://sibeeshpassion.com/wp-content/uploads/2020/03/Generate-SSH-Keys-1024x709.png" alt="" class="wp-image-14034" srcset="/wp-content/uploads/2020/03/Generate-SSH-Keys-1024x709.png 1024w, /wp-content/uploads/2020/03/Generate-SSH-Keys-300x208.png 300w, /wp-content/uploads/2020/03/Generate-SSH-Keys-768x532.png 768w, /wp-content/uploads/2020/03/Generate-SSH-Keys-425x294.png 425w, /wp-content/uploads/2020/03/Generate-SSH-Keys.png 1099w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Generate SSH Keys</figcaption></figure></div>



<h3 class="wp-block-heading">Update the SSH Key in Source DevOps and Clone the Repository</h3>



<p>Now go to your source organization and add the Public Key Data under the <em>SSH public keys</em> section. You can find this public key in <code>.ssh</code> folder.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="703" height="274" src="https://sibeeshpassion.com/wp-content/uploads/2020/03/Public-Key-in-SSH-Folder.png" alt="" class="wp-image-14044" srcset="/wp-content/uploads/2020/03/Public-Key-in-SSH-Folder.png 703w, /wp-content/uploads/2020/03/Public-Key-in-SSH-Folder-300x117.png 300w, /wp-content/uploads/2020/03/Public-Key-in-SSH-Folder-425x166.png 425w" sizes="(max-width: 703px) 100vw, 703px" /><figcaption>Public Key in SSH Folder.png</figcaption></figure></div>



<p>Let&#8217;s add a new SSH key now.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="1024" height="500" src="https://sibeeshpassion.com/wp-content/uploads/2020/03/Add-a-new-SSH-Key-1024x500.png" alt="" class="wp-image-14035" srcset="/wp-content/uploads/2020/03/Add-a-new-SSH-Key-1024x500.png 1024w, /wp-content/uploads/2020/03/Add-a-new-SSH-Key-300x146.png 300w, /wp-content/uploads/2020/03/Add-a-new-SSH-Key-768x375.png 768w, /wp-content/uploads/2020/03/Add-a-new-SSH-Key-1536x750.png 1536w, /wp-content/uploads/2020/03/Add-a-new-SSH-Key-425x207.png 425w, /wp-content/uploads/2020/03/Add-a-new-SSH-Key.png 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Add a new SSH Key</figcaption></figure></div>



<p>Now we can get the SSH clone URL and clone our repository. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="460" height="312" src="https://sibeeshpassion.com/wp-content/uploads/2020/03/Clone-Repository-Using-SSH.png" alt="" class="wp-image-14036" srcset="/wp-content/uploads/2020/03/Clone-Repository-Using-SSH.png 460w, /wp-content/uploads/2020/03/Clone-Repository-Using-SSH-300x203.png 300w, /wp-content/uploads/2020/03/Clone-Repository-Using-SSH-425x288.png 425w" sizes="(max-width: 460px) 100vw, 460px" /><figcaption>Clone Repository Using SSH</figcaption></figure></div>



<p>You should get a result as in the preceding image if everything correct. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="1024" height="344" src="https://sibeeshpassion.com/wp-content/uploads/2020/03/Clone-Result-1024x344.png" alt="" class="wp-image-14037" srcset="/wp-content/uploads/2020/03/Clone-Result-1024x344.png 1024w, /wp-content/uploads/2020/03/Clone-Result-300x101.png 300w, /wp-content/uploads/2020/03/Clone-Result-768x258.png 768w, /wp-content/uploads/2020/03/Clone-Result-425x143.png 425w, /wp-content/uploads/2020/03/Clone-Result.png 1123w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Clone Result</figcaption></figure></div>



<h3 class="wp-block-heading">Check out all the Branches and Tags</h3>



<p>Now let us just go inside of the cloned project and make sure all the branches are available by running <strong><code>git branch -a</code></strong>.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="560" height="181" src="https://sibeeshpassion.com/wp-content/uploads/2020/03/git-branch-all.png" alt="" class="wp-image-14038" srcset="/wp-content/uploads/2020/03/git-branch-all.png 560w, /wp-content/uploads/2020/03/git-branch-all-300x97.png 300w, /wp-content/uploads/2020/03/git-branch-all-425x137.png 425w" sizes="(max-width: 560px) 100vw, 560px" /><figcaption>git branch all</figcaption></figure></div>



<p>Now it is time to <strong>check out all the branches locally</strong> so that they can be pushed to our new Organization DevOps. This is really important if you need those branches. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="1024" height="364" src="https://sibeeshpassion.com/wp-content/uploads/2020/03/Check-out-all-the-branches-1024x364.png" alt="" class="wp-image-14039" srcset="/wp-content/uploads/2020/03/Check-out-all-the-branches-1024x364.png 1024w, /wp-content/uploads/2020/03/Check-out-all-the-branches-300x107.png 300w, /wp-content/uploads/2020/03/Check-out-all-the-branches-768x273.png 768w, /wp-content/uploads/2020/03/Check-out-all-the-branches-1536x546.png 1536w, /wp-content/uploads/2020/03/Check-out-all-the-branches-425x151.png 425w, /wp-content/uploads/2020/03/Check-out-all-the-branches.png 1597w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Check out all the branches</figcaption></figure></div>



<p>Now fetch all of your tags too by running <code>git fetch --tags</code>. Once that is done you can verify once again whether all the branches are downloaded locally or not. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="427" height="205" src="https://sibeeshpassion.com/wp-content/uploads/2020/03/All-branches-downloaded-locally.png" alt="" class="wp-image-14040" srcset="/wp-content/uploads/2020/03/All-branches-downloaded-locally.png 427w, /wp-content/uploads/2020/03/All-branches-downloaded-locally-300x144.png 300w, /wp-content/uploads/2020/03/All-branches-downloaded-locally-425x204.png 425w" sizes="(max-width: 427px) 100vw, 427px" /><figcaption>All branches downloaded locally</figcaption></figure></div>



<h3 class="wp-block-heading">Update the SSH Key in the Destination DevOps</h3>



<p>Follow the same procedure as you did for the source DevOps and update the SSH public key there.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="956" height="445" src="https://sibeeshpassion.com/wp-content/uploads/2020/03/Destination-DevOps-SSH.png" alt="" class="wp-image-14041" srcset="/wp-content/uploads/2020/03/Destination-DevOps-SSH.png 956w, /wp-content/uploads/2020/03/Destination-DevOps-SSH-300x140.png 300w, /wp-content/uploads/2020/03/Destination-DevOps-SSH-768x357.png 768w, /wp-content/uploads/2020/03/Destination-DevOps-SSH-425x198.png 425w" sizes="(max-width: 956px) 100vw, 956px" /><figcaption>Destination DevOps SSH</figcaption></figure></div>



<h3 class="wp-block-heading">Remove Old and Add New Origin </h3>



<p>Now comes the important step. Here we are removing the old Origin and add our new Origin so that we can push all our changes including the branches and tags. So we are going to run the below commands one by one.</p>



<pre class="wp-block-preformatted">git remote rm origin
git remote add origin <new ssh origin from destination devops>
git push origin --all
git push --tags</pre>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="1024" height="473" src="https://sibeeshpassion.com/wp-content/uploads/2020/03/Remove-Old-and-Add-New-Origin-1024x473.png" alt="" class="wp-image-14042" srcset="/wp-content/uploads/2020/03/Remove-Old-and-Add-New-Origin-1024x473.png 1024w, /wp-content/uploads/2020/03/Remove-Old-and-Add-New-Origin-300x139.png 300w, /wp-content/uploads/2020/03/Remove-Old-and-Add-New-Origin-768x355.png 768w, /wp-content/uploads/2020/03/Remove-Old-and-Add-New-Origin-1536x709.png 1536w, /wp-content/uploads/2020/03/Remove-Old-and-Add-New-Origin-425x196.png 425w, /wp-content/uploads/2020/03/Remove-Old-and-Add-New-Origin.png 1579w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Remove Old and Add New Origin</figcaption></figure></div>



<p>As you can see in the above image, all of our codebases now is been uploaded to the new Azure DevOps. I told you already it is not that hard as it sounds.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="762" height="459" src="https://sibeeshpassion.com/wp-content/uploads/2020/03/All-the-branches-in-new-DevOps.png" alt="" class="wp-image-14043" srcset="/wp-content/uploads/2020/03/All-the-branches-in-new-DevOps.png 762w, /wp-content/uploads/2020/03/All-the-branches-in-new-DevOps-300x181.png 300w, /wp-content/uploads/2020/03/All-the-branches-in-new-DevOps-425x256.png 425w" sizes="(max-width: 762px) 100vw, 762px" /><figcaption>All the branches in new DevOps</figcaption></figure></div>



<p>One thing to notice here is that the new repository will contain your branch history too. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="958" height="1024" src="https://sibeeshpassion.com/wp-content/uploads/2020/03/History-of-the-branches-958x1024.png" alt="" class="wp-image-14050" srcset="/wp-content/uploads/2020/03/History-of-the-branches-958x1024.png 958w, /wp-content/uploads/2020/03/History-of-the-branches-281x300.png 281w, /wp-content/uploads/2020/03/History-of-the-branches-768x821.png 768w, /wp-content/uploads/2020/03/History-of-the-branches-425x454.png 425w, /wp-content/uploads/2020/03/History-of-the-branches.png 1052w" sizes="(max-width: 958px) 100vw, 958px" /><figcaption>History of the branches</figcaption></figure></div>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Thanks a lot for reading this article. I hope now you have learned about</p>



<ul class="wp-block-list"><li>the basic git commands</li><li>how to configure SSH connection in Azure DevOps</li><li>how to push the repositories to another DevOps</li></ul>



<p>If you have learned anything else from this article, please let me know in the comment section.</p>



<h2 class="wp-block-heading">Follow me</h2>



<p>If you like this article, consider following me, haha!.</p>



<ul class="wp-block-list"><li><a href="https://github.com/SibeeshVenu">GitHub</a></li><li><a href="https://medium.com/@sibeeshvenu">medium</a></li><li><a href="https://twitter.com/sibeeshvenu">Twitter</a></li></ul>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>Thanks a lot for reading. Did I miss anything that you may think which is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.</p>



<p>Kindest Regards<br>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/move-git-repositories-from-one-to-other-organization-in-azure-devops/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
