Reputation: 145
I'm really desparing. I just installed a Team Foundation Server to move from an older simple git server to it. So now I'm having many branches on my old git server which I'd like to migrate to the TFS but actually I can't.
I created the project in the TFS, tried to clone it into Visual Studio and wanted to push my old files with git push --mirror origin
. Before I set the TFS git repo to my remote origin.
For the TFS it worked, I had two branches there which I had in my old git as well. But Visual Studio didn't notice that I have these. I don't know what I did wrong.
Is there an easy way to migrate an existing git server to the TFS? With all branches that existed before?
Upvotes: 2
Views: 739
Reputation: 151
Clone old repo:
git clone {our_old_repo}
Pull in remote branches, for each branch execute (or make a powershell script if you have too many branches for manual labor):
git branch {branchname} origin/{branchname}
Re-target to new repo location:
git remote set-url origin {your_new_repo}
Push all code to new repo:
git push -a
Upvotes: 1
Reputation: 59065
Do a fetch. Visual Studio has no way of knowing that it needs to sync up with the remote repo unless you tell it.
Upvotes: 0