git-tfs can I clone all branches but skip the history?

我们两清 提交于 2021-02-19 07:33:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!