Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git to TFS 2008 one way migration (with history)

Tags:

git

tfs

git-tfs

I'm a newbie to Git. I'm exploring one-way one-time migration of Git repository to TFS (with history). I'm looking into plugin git-tfs. I couldn't find any help/wiki/blog on this particular scenario. Can I use git-tfs checkin or git-tfs clone command in this case? Any examples would be great!! Thank you!!

like image 401
Manish Jain Avatar asked Jan 31 '12 23:01

Manish Jain


People also ask

Can we use Git to clone from TFS?

Cloning the whole TFS Project CollectionYou can clone all projects by specifying $/ as the tfs-repository path. If you do not specify a git repository name, it will clone into tfs-collection .

What is difference between Git and TFVC?

Git is the default version control provider for new projects. You should use Git for version control in your projects and begin to move your existing TFVC projects to Git. TFVC is considered feature complete. Azure DevOps will maintain compatibility with TFVC, but Git will receive all future investment.

Should I migrate from TFVC to Git?

Due to the differences in how TFVC and Git store version control history, we recommend that you don't migrate your history. This is the approach that Microsoft took when it migrated Windows and other products from centralized version control to Git.


1 Answers

I was able to do it on test repository. Big thanks to Ivan Danilov. Here are exact steps:

  1. Download zip
  2. Unblock (right click file->properties->unblock) downloaded files (win 7 for me)
  3. Copy to C:\Program Files (x86)\Git\bin
  4. Now you should be able to run Git tfs commands.
  5. Create empty TFS target folder (assuming you are migrating to empty folder)
  6. Bind TFS to Git repository and then upload Git changes to TFS. (Run commands in sequence):
   git tfs init http://server:8080/tfs/collection $/project -d 
   git tfs pull
   git rebase tfs/default
   git tfs rcheckin

Please note rebase is the key. It could be more complicated if you have branches etc and I haven't tried those scenarios.

Please see this link and this link for more details.

GitTFS

like image 132
Manish Jain Avatar answered Sep 21 '22 05:09

Manish Jain