简体   繁体   中英

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

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

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

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.

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM