Migrate a complete Git Repository from TFS to VSTS

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 !

Advertisements

4 Responses to “Migrate a complete Git Repository from TFS to VSTS”

  1. Haha, it’s the magic mirrror switch!

  2. 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

%d bloggers like this: