Artem Tikhomirov Artem Tikhomirov - 1 year ago 116
Git Question

Git to TFS Source Control Migration

I'd like to see how TFS will work for my command. So I'd like to move our current GIT repository to TFS database. We've used GIT for it's prevailed branching support so I'd like to use TFS 2010 to address that issue.

Now question is. How do I export our GIT repo to TFS. Obviously it's some kind of script. Does have anyone done that? Any suggestions?

Thank you.

Answer Source

Microsoft have now released their own GIT <--> TFS extension for GIT: GIT-TF

This allows pulling a new GIT repository from TFS or configuring to allow GIT to TFS pushes, which is what you want to do:

(from the documentation)

For a team working with an existing Git repo, a developer sharing changes to TFS using Git-TF would use the following workflow.

# Configure the existing repo's relationship with TFS
git tf configure http://myserver:8080/tfs $/TeamProjectA/Main

# Fetch the latest changes from TFS and merge those 
# changes with the local changes.
# Note, merging is important when working in a team configuration. 
# See "Rebase vs. Merge" below.
git tf pull

git commit -a -m "merge commit"

# Check in the merge commit as a single TFS changeset
git tf checkin

# Push the merge commit to the origin
git push

In addition, the preexisting open-source GIT-TFS solution can be used (from Windows only, Microsoft's solution uses Java and is cross-platform), described in an answer to Git to TFS 2008 one way migration (with history)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download