Azure DevOps – Tips and Tricks – 22 – Import Git repository

In this article, we are going to learn how to import a git repository from one project to another project.

Advertisements

Introduction

Sometimes, when you want to start a new assignment, you may want to copy from an existing codebase instead of starting all over again. In order to solve this, Azure DevOps allows us to import the repository from within the project or across other projects.

Below are a few simple use cases of when you would like to import a git repository into an Azure DevOps Project

  1. Migrate a Repository from GitHub to Azure DevOps
  2. Copy a Repository from one Azure DevOps project to another project within the same Organization
  3. Copy the repository across two different Organizations.
Advertisements

In this article, we will discuss about the simplest use case explained in the item #2 above where we copy the repository from a source project to a target project within the same organization.

Prerequisites

  1. Create two projects Source project and the Target Project.
  2. Create a git repository in the Source project
Advertisements

Import Git Repository

Navigate to the Source Project which you would like to copy. As shown below, click on the Repo name, click on the Clone button and then copy the URL of the repo and save it a notepad.

Azure DevOps – Tips and Tricks – Import Git impository – Source Repo – Clone

Next step is to click on the Generate the Git Credentials, copy the Username and the Password as shown below

Azure DevOps – Tips and Tricks – Import Git impository – Source Repo – Copy Git Credentials

We are going to use this URL, username and the password while importing the repo from another project.

Let’s now navigate to the Target Project where you would like to import the git repo.

Advertisements

Navigate to the repo section, click on the arrow mark (Step1 below) and then select the Import Repository (step2 below) which opens up the Import a Git Repository popup, where you provide the Clone URL (step3) and then click on the Requires Authentication checkbox (Step4), provide the Username and Password (Step 5 & 6) and finally click on the Import button (step7).

Azure DevOps – Tips and Tricks – Import Git Repository – Import Repository

Once you hit the Import button, it takes some time to process and after a few moments, you will see the Import Successful message as shown below.

Azure DevOps – Tips and Tricks – Import Git impository – Import Successful

Click on the Click here to navigate to code view to view the repo which is imported into the target project.

Advertisements

Summary

In this article, we have learnt how to import and existing repo from an source project to another project.

Do you like this article? If you want to get more updates about these kind of articles, you can join my Learning Groups

WhatsApp

Telegram

Advertisements
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s