首页 > 解决方案 > Git p4克隆不跟随其他分支的文件更改

问题描述

我正在尝试将我的(巨大的)p4 存储库迁移到 git。我做到了p4 clone //proj/branchA@all,它做到了预期 - 制作了一个包含创建该分支的历史的回购。问题是这个分支是从另一个分支创建的,所以第一个“提交”是Branching //proj/branchB/... to //proj/branchA/....

现在,当我尝试使用 Intellij Idea 查看注释时,我可以看到一直到创建文件的更改。Idea 运行的命令是filelog -i -l -t -m 1000 /path/to/file. 日志如下:

...
... ... branch into //proj/branchC/.../file#1
... ... branch into //proj/branchX/.../file#1
change #1234 edit on ...
... ... branch into //proj/branchY/.../file#1
...

现在显然有一种方法可以跟踪文件并查看当前分支之外的更改。有人可以帮助我使用git p4或任何其他服务转移所有历史记录吗?

标签: gitperforcegit-p4

解决方案


你可以做什么克隆两个分支以分离 repos,然后使用 git 将它们组合在一起。

不幸的是,我不记得如何将树枝嫁接在一起的全部细节。

https://superuser.com/questions/1005412/how-can-i-make-a-set-of-commits-the-children-of-another-commit-in-git

可能https://git-scm.com/docs/git-filter-branch会有所帮助。


推荐阅读