Skip to content

Utilities to migrate a Git Repo from Azure DevOps to GitHub (including history, branches and tags)

License

Notifications You must be signed in to change notification settings

n3wt0n/AzureDevOpsToGitHubRepoMigrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure DevOps To GitHub Repository Migrator

Validate PowerShell Docker CI/CD Validate YAML License

Utilities to migrate a Git Repo from Azure DevOps to GitHub.

It will migrate ALL you have in your repository, including all the branches, all the tags and the complete history of commits.

Video

If you want to see an in-depth explanation on how to migrate from Azure DevOps Repos to GitHub, check this video on YouTube:

Migreate to GitHub

Usage

There are 3 main ways to perform the migration:

  • Scripts
    • Manually or Automated
    • Verbose or Silent
    • Check the README for more info
  • Docker container
  • Azure Container Instances
    • Use the scripts i the ACI folder to deploy to Azure ACI
    • Check the README for more info

Migration Steps

The migrator will perform the migration in 4 steps:

  1. Make sure you have a local copy of all "old repo", branches and tags
  • Create a new folder (with name in the format "AZUREDEVOPSREPONAME-Migration")
  • Clone the Azure DevOps repo into it
  • Check out all the branches and tags as well
  1. Add the GitHub repo as a new remote origin
  2. Push all local branches and tags to the new repo
  3. Clean up. Remove the Azure DevOps repo and its dependencies from the origins, set the GitHub one as only origin

Prerequisites

Both the scripts and the containerized version require a series of prerequisites to work.

Azure DevOps

You need to know/have:

  • The name of the Azure DevOps Organization where your source repository resides (the XXX in dev.azure.com/XXX or XXX.visualstudio.com)
  • The name of the Azure DevOps Team Project_ where the source repository resides
  • The name of the Azure DevOps Source Repository to migrate (because a single Team Project may contain multiple repositories)

You also need to generate a PAT (Personal Access Token) in Azure DevOps with the following permissions:

  • Code
    • Read

For instruction on how to generate a PAT in Azure DevOps, take a look at the official documentation here

GitHub

You need to know/have:

  • The GitHub Username or (Organization) with which you have created the destination repository
  • The name of the GitHub Destination Repository

Please note that the Destination Repo must be empty and not be initialized.

You also need to generate a PAT (Personal Access Token) in GitHub with the following permissions:

  • repo (Full control)

For instruction on how to generate a PAT in GitHub, take a look at the official documentation here