I am migrating some Git repositories from a TFS server to VSTS. Moving a Git repo including all the history is very simple fo course. Since Git is a Distributed Source Control repository. But I always forget the syntax of moving the “complete” Git repository at once. With all the branches, tags etc.
So here it is. At least for 1 reader in the future..Me..
Clone the Git repo with everything in it
git clone [old git url] --mirror
Add the new remote
git remote add vsts [new git url]
Push all the changes
git push vsts --mirror
That’s it !
Haha, it’s the magic mirrror switch!
Now that I have wrote it down I probably won’t ever forget it anymore 🙂
I’m facing an issue. It shows me the below
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as ‘master’.
Everything up-to-date
Have you created a new repo ?