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 !