Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrate Git to TFS with all history

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.

like image 935
ehsandotnet Avatar asked Dec 24 '13 07:12

ehsandotnet


People also ask

Can I use Git and TFS together?

Introducing git-tfsgit-tfs provides a two-way bridge between a local Git repository and a TFS server. git-tfs allows you to do your local development in a Git repository, and still synchronize your work with a TFS server.

Should I use Git or TFVC?

Microsoft recommends Git ReposYou should use Git for version control in your projects unless you have a specific need for centralized version control features in TFVC. In other words, if you have a very specific reason why you need to continue using TFVC, Microsoft would rather you didn't.

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 TFS?

In TFS there is no simple way to save the state of your changes (file additions, modifications, file deletions), and switch to another state of code. (For example, to work on two features and switch back and forth). In git, you simply checkout a different branch.


1 Answers

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

  • Chocolatey Package: choco install git-tf

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.

like image 52
mzagozda Avatar answered Sep 22 '22 11:09

mzagozda