Sibeesh Passion

Top Menu

  • Home
  • Search
  • About
  • Privacy Policy

Main Menu

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
  • Home
  • Search
  • About
  • Privacy Policy

logo

Sibeesh Passion

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
  • Linux Azure Function Isolated Dot Net 9 YAML Template Deployment

  • Build, Deploy, Configure CI &CD Your Static Website in 5 mins

  • Post Messages to Microsoft Teams Using Python

  • Get Azure Blob Storage Blob Metadata Using PowerShell

  • Deploy .net 6 App to Azure from Azure DevOps using Pipelines

Azureazure devops
Home›Azure›Move Git Repositories From One to Other Organization in Azure DevOps

Move Git Repositories From One to Other Organization in Azure DevOps

By SibeeshVenu
March 6, 2020
0
0
Share:

[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’t want to pay anything for this small requirement. So let’s just see how I achieved this. Trust me this is not a tough task as it sounds.

Background

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.

Move Repositories to Another Organization’s DevOps

Add a User to Both Organization

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’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.

Configure SSH Key

To create one Generate the RSA key pair by running the ssh-keygen command.

Generate SSH Keys

Update the SSH Key in Source DevOps and Clone the Repository

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

Public Key in SSH Folder.png

Let’s add a new SSH key now.

Add a new SSH Key

Now we can get the SSH clone URL and clone our repository.

Clone Repository Using SSH

You should get a result as in the preceding image if everything correct.

Clone Result

Check out all the Branches and Tags

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

git branch all

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

Check out all the branches

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

All branches downloaded locally

Update the SSH Key in the Destination DevOps

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

Destination DevOps SSH

Remove Old and Add New Origin

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.

git remote rm origin
git remote add origin 
git push origin --all
git push --tags
Remove Old and Add New Origin

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.

All the branches in new DevOps

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

History of the branches

Conclusion

Thanks a lot for reading this article. I hope now you have learned about

  • the basic git commands
  • how to configure SSH connection in Azure DevOps
  • how to push the repositories to another DevOps

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

Follow me

If you like this article, consider following me, haha!.

  • GitHub
  • medium
  • Twitter

Your turn. What do you think?

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.

Kindest Regards
Sibeesh Venu

TagsAzureAzure DevOpsgitgit repository managemove git repository to other
Previous Article

Azure Form Recognizer and Microsoft Flow to ...

Next Article

Move Azure DevOps Work Items From One ...

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0

SibeeshVenu

I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer.

Related articles More from author

  • Send MXChip Data to Cloud
    ArduinoAzureIoT

    Detect Noise Level Audio Decibels in MXChip Azure IoT DevKit

    January 14, 2019
    By SibeeshVenu
  • Microsoft Azure Logo
    Azure

    What Azure Is?

    July 8, 2015
    By SibeeshVenu
  • Azure

    Deploy Angular App Using Azure DevOps Build and Release Pipelines

    January 7, 2019
    By SibeeshVenu
  • AzureHow to

    How to host a website in Azure

    June 1, 2015
    By SibeeshVenu
  • Send Temperature, Humidity, Pressure from MXChip Output
    ArduinoAzureIoT

    MXChip Device with Pressure, Humidity, Temperature Info using Azure IoT Workbench

    January 4, 2019
    By SibeeshVenu
  • AzureVideos

    Encrypt an Azure Virtual Machine VHD File in 5 Minutes

    September 3, 2019
    By SibeeshVenu
0

My book

Asp Net Core and Azure with Raspberry Pi Sibeesh Venu

YouTube

MICROSOFT MVP (2016-2022)

profile for Sibeesh Venu - Microsoft MVP

Recent Posts

  • Linux Azure Function Isolated Dot Net 9 YAML Template Deployment
  • Build, Deploy, Configure CI &CD Your Static Website in 5 mins
  • Easily move data from one COSMOS DB to another
  • .NET 8 New and Efficient Way to Check IP is in Given IP Range
  • Async Client IP safelist for Dot NET
  • Post Messages to Microsoft Teams Using Python
  • Get Azure Blob Storage Blob Metadata Using PowerShell
  • Deploy .net 6 App to Azure from Azure DevOps using Pipelines
  • Integrate Azure App Insights in 1 Minute to .Net6 Application
  • Azure DevOps Service Connection with Multiple Azure Resource Group

Tags

Achievements (35) Angular (14) Angular 5 (7) Angular JS (15) article (10) Article Of The Day (13) Asp.Net (14) Azure (65) Azure DevOps (10) Azure Function (10) Azure IoT (7) C# (17) c-sharp corner (13) Career Advice (11) chart (11) CSharp (7) CSS (7) CSS3 (6) HighChart (10) How To (9) HTML5 (10) HTML5 Chart (11) Interview (6) IoT (11) Javascript (10) JQuery (82) jquery functions (9) JQWidgets (15) JQX Grid (17) Json (7) Microsoft (8) MVC (20) MVP (9) MXChip (7) News (18) Office 365 (7) Products (10) SQL (20) SQL Server (15) Visual Studio (10) Visual Studio 2017 (7) VS2017 (7) Web API (12) Windows 10 (7) Wordpress (9)
  • .NET
  • Achievements
  • ADO.NET
  • Android
  • Angular
  • Arduino
  • Article Of The Day
  • ASP.NET
  • Asp.Net Core
  • Automobile
  • Awards
  • Azure
  • Azure CDN
  • azure devops
  • Blockchain
  • Blog
  • Browser
  • C-Sharp Corner
  • C#
  • Career Advice
  • Code Snippets
  • CodeProject
  • Cognitive Services
  • Cosmos DB
  • CSS
  • CSS3
  • Data Factory
  • Database
  • Docker
  • Drawings
  • Drill Down Chart
  • English
  • Excel Programming
  • Exporting
  • Facebook
  • Fun
  • Gadgets
  • GitHub
  • GoPro
  • High Map
  • HighChart
  • How to
  • HTML
  • HTML5
  • Ignite UI
  • IIS
  • Interview
  • IoT
  • JavaScript
  • JQuery
  • jQuery UI
  • JQWidgets
  • JQX Grid
  • Json
  • Knockout JS
  • Linux
  • Machine Learning
  • Malayalam
  • Malayalam Poems
  • MDX Query
  • Microsoft
  • Microsoft ADOMD
  • Microsoft MVP
  • Microsoft Office
  • Microsoft Technologies
  • Microsoft Windows
  • Microsoft Windows Server
  • Mobile
  • MongoDB
  • Monthly Winners
  • MVC
  • MVC Grid
  • MySQL
  • News
  • Node JS
  • npm
  • Number Conversions
  • October 2015
  • Office 365
  • Office Development
  • One Plus
  • Outlook
  • Page
  • PHP
  • Poems
  • PowerShell
  • Products
  • Q&A
  • Raspberry PI
  • React
  • SEO
  • SharePoint
  • Skype
  • Social Media
  • Software
  • Spire.Doc
  • Spire.PDF
  • Spire.XLS
  • SQL
  • SQL Server
  • SSAS
  • SSMS
  • Storage In HTML5
  • Stories
  • Third Party Software Apps
  • Tips
  • Tools
  • Translator Text
  • Uncategorized
  • Unit Testing
  • UWP
  • VB.Net
  • Videos
  • Virtual Machine
  • Visual Studio
  • Visual Studio 2017
  • Wamp Server
  • Web API
  • Web Platform Installer
  • Webinars
  • WebMatrix
  • Windows 10
  • Windows 7
  • Windows 8.1
  • Wordpress
  • Writing

ABOUT ME

I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer. If you would like to know more about me, you can read my story here.

Contact Me

  • info@sibeeshpassion.com

Pages

  • About
  • Search
  • Privacy Policy
  • About
  • Search
  • Privacy Policy
© Copyright Sibeesh Passion 2014-2025. All Rights Reserved.
Go to mobile version