Git to TFS 2008 one way migration (with history)
Asked Answered
A

1

10

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!!

Abyssinia answered 31/1, 2012 at 23:16 Comment(3)
Does this help? elegantcode.com/2011/03/15/…Lithuanian
Thanks KMoraz for the link! It didn't cover TFS push part.Abyssinia
FYI, Microsoft just released cross platform plug-in: git-tf. Please see video here - channel9.msdn.com/Blogs/VisualStudio/…Abyssinia
A
4

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.

Git TFS

Abyssinia answered 8/2, 2012 at 22:0 Comment(3)
This looks as if it doesn't preserve history - or if it does you have to do a new git tfs rcheckin for each changeset from git. Is this correct? Also, how well does it handle renames and deletes?Scoles
I did rcheckin only once after rebase. I haven't tried but I see multiple open issues on renames here: github.com/git-tfs/git-tfs/issuesAbyssinia
I get out of memory issues when trying to rebase a large repository - has anyone encountered similar issues?Linoleum

© 2022 - 2024 — McMap. All rights reserved.