I'm trying to create a new repository in Azure DevOps based on an old repository also in Azure DevOps, but the transfer is not working.
The new repository is under a new project and organization. When I create it and go to Repos, I see this:
It seems like I have two options for importing the old repository over to this one:
- Push an existing repository from command line.
- Import a repository.
When I try to push an existing repository from the command line, I copy and paste the commands it gives me to the command line (PowerShell) while in the root of the project directory on my local computer (where the .git folder and .sln file are). The command is:
git remote add origin https://[email protected]/holland-and-barnes/Holland%20and%20Barnes/_git/Holland%20and%20Barnes
Running this command, it tells me:
usage: git remote add [<options>] <name> <url>
-f, --fetch fetch the remote branches
--tags import all tags and associated objects when fetching
or do not fetch any tag at all (--no-tags)
-t, --track <branch> branch(es) to track
-m, --master <branch>
master branch
--mirror[=(push|fetch)]
set up remote as a mirror to push to or fetch from
...and then:
git push -u origin --all
Running this command, it tells me:
Everything up-to-date
Branch 'master' set up to track remote branch 'master' from 'origin'.
And yet, back at dev.azure.com, it still says "Holland and Barnes is empty. Add some code!"
So I try the second method (importing from the old repository).
I click "Import" and it brings up the "Import a Git repository" popup:
I keep the repository type as Git and I enter the following for the Clone URL:
https://wardrop.visualstudio.com/Holland%20And%20Barnes/_git/Holland%20And%20Barnes
I get this directly from the Clone Repository popup of the old repository (Repos >> click on Clone):
I check "Requires Authentication" and enter my username and Password. I click "Import".
But it tells me in pink at the top:
Import request cannot be processed due to one of the following reasons:
Clone URL is incorrect.
Clone URL requires authorization
I am sure I'm entering my credentials properly. I copied the clone URL directly from the old repository. What else can I do?