1

I want to migrate a project from TFVC to Git. I want to keep the different branches but I dont need each history. Can it be done?

I tried git tfs quick-clone -branches=all but I only fetches one branch

Jepzen
  • 2,942
  • 6
  • 40
  • 62

4 Answers4

1

If you want to work with tfs branches, you should clone one of the root branches. After you perform git push, all branches will be pushed to Git team projects.

Generally, the following steps would achieve your goal:

git-tfs clone http://tfsserver:8080/tfs/CollectionName/ $/teamproject/project .

git remote add origin http://tfsserver:8080/tfs/CollectionName/_git/gitproject

git push --all origin
Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
1

Solution was more simple than I first thought. Just create a new empty Git repository. Create a second branch. Copy files in from TFSVC folder. Commit. Switch branch, copy in the other TFSVC branch. Commit.

Jepzen
  • 2,942
  • 6
  • 40
  • 62
0

That's not possible but you could do as much 'quick-clone' as you want in different repositories and use the git remote feature to import them all in the same repository.

Not easy but doable...

Philippe
  • 28,207
  • 6
  • 54
  • 78
  • I did two quick clones of the two branches needed. Can i just add the same remote and push them? With different names first i suspect? – Jepzen Oct 09 '16 at 19:14
  • Once the 2nd remote is imported in the 1st repository, so a 'git tfs bootstrap' and then you should be able to commit and checkin/push... – Philippe Oct 09 '16 at 23:56
0

https://github.com/git-tfs/git-tfs/blob/master/doc/commands/quick-clone.md

The quick-clone command creates a new git repository, initialized from the last changeset (or a specific changeset in history) in a TFS source tree, ignoring the full history. Useful for making code changes or additions where past history isn't relevant.

"quick-clone": If you dont mind which has the last changeset.

YUu
  • 69
  • 8