Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Clone URL is incorrect' when importing from GitHub to Azure DevOps

I am trying to import a GitHub repository to Azure DevOps and I keep getting this error:

Import request cannot be processed due to one of the following reasons:

Clone URL is incorrect.
Clone URL requires authorization.

Here is a screenshot of my input parameters: Import error and input parameters

I have double and triple checked the cloning url and the authentication parameters. No matter what I put into the fields it always displays these two errors. How can I trouble shoot this?

like image 818
Sigmundur Avatar asked Feb 20 '20 13:02

Sigmundur


People also ask

How do I clone a repository from GitHub to Azure DevOps?

From your web browser, open the team project for your Azure DevOps organization, and then choose Repos > Files to open the Files view. In the Files view, choose Clone to launch the Clone Repository popup. Copy the clone URL from the Clone Repository popup.

How does GitHub repository connect to Azure DevOps?

Open Project Settings>GitHub Connections. Sign into Azure Boards for the project you want to connect to GitHub repositories. Choose (1) Project Settings> (2) GitHub connections. If it's the first time making a connection from the project, choose Connect your GitHub account to use your GitHub account credentials.


1 Answers

Got the very same problem when trying to make a fresh new import of a private GitHub repo managed by an Organization to my new Azure DevOps account (even though my account is the owner of both GitHub and Azure DevOps profiles I was trying to link).

Three steps actually helped me to resolve it:

  1. Link two accounts via Azure DevOps > your project > Project Settings > GitHub connections. If your GitHub repo is stored in an Organization profile, here you have to make sure that you grant access to this Organization while you're setting up the connection in Azure DevOps (there will be a small Grant button next to the identified Organization profile in Azure DevOps, you have to press it to actually grant the access). In my case I missed it and the connection did not work (Azure DevOps couldn't find any repos in the GitHub profile). To resolve this, I had to follow the link from an automatic e-mail sent to me by GitHub and grant access to Azure DevOps there. Then in Github > your organization > Organization Settings > Third-party access you will be able to see Azure DevOps in the list - if the status is Approved, you're good to go.

  2. Then I had to create a PAT for my personal profile in GitHub (NOT the Organization profile) and use it instead of the password when I was importing the repo in Azure DevOps (big thanks to @Yang Shen who pointed this out above). This way you first have to go to Github > your profile > Profile Settings > Developer Settings > Personal access tokens and generate a new token there.

  3. Then I returned to Azure DevOps > your project > Repos > Files > Import, putting in: a) Link to my private Github repo; b) Tick "Authentication required"; c) My GitHub username; d) My PAT generated at Step 2 above instead of my actual password

Then it worked like a charm, my private Github repo was cloned to Azure Repos.

like image 114
Nikita Kalganov Avatar answered Sep 18 '22 11:09

Nikita Kalganov