问题
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
回答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
回答2:
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.
回答3:
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...
来源:https://stackoverflow.com/questions/39772578/git-tfs-can-i-clone-all-branches-but-skip-the-history