Migrating from Azure Repos to GitHub

House icon

Published April 30, 2021

Principal Consultant

Magnus Timner

Why

Both Azure Repos and GitHub handle ordinary code operations like commits and pull request in a nice way but GitHub has some advantages when it comes to code security.

  • Dependency scanning, identifies and alerts you for third-party vulnerabilities in your code.
  • Dependabot, creates pull request to fix your identified dependency problems
  • Code scanning, identifies and prevents code vulnerabilities
  • Secret Scanning, helps you to identify secrets like tokens and connections strings when they are committed to your code.
  • Codespaces lets you create an instant development environment in a browser where you can Code, build, test, debug, and deploy. It also integrates directly into Visual Studio Code

Dependency scanning and Dependabot are free for both private and public repos, Code Scanning and Secret Scanning are free for public repos but not for private repos.

Integration

The integration between Azure DevOps and GitHub is good, if you move your code to GitHub you can still continue building and planning in Azure DevOps and link your commits and pull request to work items in Azure DevOps.

How to do it

For starters, your target GitHub Repo has to be created and empty.

Importing to GitHub.com

If you are using GitHub.com you can use the build in import feature.

Importing with git commands

If you want to do it by command you can do it this way, the mirror flag is to get all the remote branches: <BR>

  1. Open Git Bash <BR>
  2. Create a mirror clone of the repository. <BR>

$ git clone --mirror <old-repository.git> <BR>
3. Mirror-push to the new repository. <BR>
$ cd old-repository <BR>
$ git push --mirror https://github.com/exampleuser/new-repository.git <BR>
4. Remove the temporary local repository you created earlier. <BR>

The result:

More actions

Other things to make things easier could be to script this and use the GitHub CLI to create the target projects

Check out Solidifys own secret scanner

Solidify and GitHub

Early 2020, we announced the exciting news that we became one of the world's first GitHub Advanced Services and Technology Partners.

GitHub a tool we very much enjoy, and we understand why so many others do, too. If you're interested, take a look at our GitHub page here.

If you are looking for help to migrate from Azure DevOps to GitHub take a look at our Go To GitHub Service

If you want to know more about us here at Solidify, take a look at our About page.