Migrate Git to TFS with all history
Asked Answered
A

2

17

Is there any way to migrate a git repository to TFS with all it's history like versions, branches and push messages? Now the source is on Github and I want to migrate that to my local TFS repository.

Assertive answered 24/12, 2013 at 7:54 Comment(1)
possible duplicate of Git to TFS Source Control MigrationLauritz
M
12

Install git-tf from Codeplex source, MS Downloads, or better yet:

Then run the following commands:

  1. First you need to configure your GIT repository

    git tf configure http://yourserver.com:8080/tfs/DefaultCollection $/RepositoryName
    
  2. Check in the files, optionally persisting author/USERMAP:

    git tf checkin --deep --autosquash --keep-author
    

This process is very slow, but it works, so ensure you have plenty of time to spend migrating. The only downside is that commit time will be the current checkin time, not the original changeset time.

Marcelinomarcell answered 2/1, 2015 at 9:32 Comment(0)
L
8

The Branches in TFS are mapped to folders, which doesn't easily convert from the way branches work in Git. Grabbing one branch and pushing that, with history to TFS should be possible though. You'll have to use Git tf checkin --deep

See:

If you want to migrate to TFS the easiest migration path is to TFS 2013 or Visual Studio Online, which has native Git support.

Leveret answered 24/12, 2013 at 10:55 Comment(1)
What a great reference that blog is ;)Halfhardy

© 2022 - 2024 — McMap. All rights reserved.