C:\>git tf clone https://companyname.visualstudio.com/DefaultCollection $/companyname/Main OldTFS --deep
这只会让我获得主要分支的历史记录。那是 git tf
。
C:\>git tfs 克隆 https://companyname.visualstudio.com/DefaultCollection $/companyname/Main --with-branches
在其中一个 merge 变更集上获取几个分支后失败,说请将此案例报告给 git-tfs 开发人员! (报告在这里:https://github.com/git-tfs/git-tfs/issues/461)
。 git branch
给我这个
Release/20120719.1
Sprint/Sprint044
Sprint/Sprint045
Sprint/Sprint047
Sprint/Sprint048
Sprint/Sprint049
Sprint/Sprint050
*master
我已经分支到 Sprint085 和相当多的发布分支。那是 git tfs
有什么方法可以使用 git tf
获取其他几个正确创建 merge 提交的分支,以便我可以正确查看历史记录?
最佳答案
免责声明:我是为 git-tfs 添加分支支持的人......
忘记 git tf
它不支持分支。
This fails after fetching few branches at one of the merge changesets saying that I should inform them with the details so they can improve.
也许你应该点击 git-tfs
给出的链接 ;)
链接是 this one .在那里的消息中,您被告知一个 work in progress获得更好的分支支持。
你真的应该尝试一下。它的状态非常好,并允许支持 2 个其他分支模式:分支重命名和无基础 merge 。有了最后这 2 个模式,我希望我们可以支持所有分支模式(但因为 TFS 非常令人惊讶——在不好的意义上——而且很乱,我不能保证!)
如果您不能让所有分支都得到支持,它将仍然是手动方式!但是很长:
- 只克隆另一个仓库中的分支
- 在你的主仓库中获取这个分支
- 使用grafts将你的分支链接到它的父分支(你应该在 TFS 中找到手册。祝你好运,因为 TFS 在这方面非常糟糕!)
- [可选] 使用
git filter-branch
使链接永久化。
PS:也许你甚至可以写一个小脚本来自动化所有这些......
关于git - 从具有多个分支及其历史的 TFS 迁移到 GIT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22342565/