user3439070
user3439070

Reputation: 21

Migrate from local Git repository to TFS source control project with all history

I have a local Git repository and I needed to migrate all the code and all history to TFS source control project. Anyone has a solution to share?

PS: I already know how to make the migration from local Git to TFS Git based Team Project.

Upvotes: 1

Views: 1262

Answers (2)

Philippe
Philippe

Reputation: 31147

  1. Don't do that!!! (that's not the way the history is going... Microsoft invest less and less in TFVC and a lot more on gut, their internal teams switching massively on git. You are doing a step in the past and should at least a last time convince your management to not do that not clever move. Git is here to stay and surely not TFVC so the sooner you adopt it, the better it is.)
  2. You can't migrate all the history, just the history of the main branch.
  3. Have a look at git-tf

Edit: my feeling was good... TFVC is no more a source control of the future. Microsoft itself is moving away and standardise around Git for ALL its projects!

Upvotes: 0

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31033

You can migrate all history of main branch from local repo to a new TFVC team project with following steps:

  1. Create an empty TFVC team project
  2. Go to your local Repo folder, and use git-tf checkin --deep command to checkin the local repo to a TFVC team project. By default, the checkin command will create a single TFS changeset for the aggregate of all changes made on the current branch in Git since the last checkin to TFS. When used with the --deep option, a TFS changeset will be created for each Git commit on the current branch since the last checkin to TFS.

enter image description here

Upvotes: 3

Related Questions