Reputation: 175
So I have this simple requirement. I have kept a project maintained on local Git Repo. and all my work with History is maintained on there. We also have a Team Foundation Server where multiple projects are setup. I wish to transfer/copy/migrate my Git project along with all the Git history to a project I have created on TFS. I will no longer use Git local after this and continue TFS for further development.
A number of solutions are available which is confusing me and I wish to do it through Visual Studio (if possible) that will not mess up the history/tracks I have maintained on Git local.
Upvotes: 3
Views: 4575
Reputation: 51183
If you want to do this through Visual Studio, you need first Connect a local repo to a remote
To connect a local repository to a hosted remote Git repository(TFS remote git repo) to share your work, go the Settings page in Team Explorer. Select Repository Settings. Under Remotes, select Add.
Enter origin in the Name field and enter the clone URL for your repo in the Fetch field. Make sure that Push matches fetch is checked and select Save.
After this you just need simply pull and push or just select the sync command in Visual Studio. TFS will auto sync your local git repo's history.
If you want to review your history of that repo, you could take a look at this tutorial.
Upvotes: 2
Reputation: 59065
There's nothing special you have to do here; TFS Git is the same as regular Git, and all the same commands work the same way.
git remote add upstream [url-to-tfs-repo]
git push upstream --all
Upvotes: 1