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

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: