gpt4 book ai didi

git - 同步存在 git repo 与 p4 repo 并继续工作

转载 作者:太空狗 更新时间:2023-10-29 13:47:12 39 4
gpt4 key购买 nike

如何将我的 git 仓库(有自己的历史)同步到 p4 仓库(有自己的历史)但是 HEAD 上的这个 repos 中的文件是相同的。

我愿意

git clone git@git.dev.local:qwerty.git
cd qwerty
git p4 sync //path/in/your/perforce/depot

得到这张图 Graph

接下来我该做什么?

当我这样做的时候

git p4 rebase

我遇到了这个错误致命:不是有效的对象名称 HEAD~97
命令失败:git cat-file commit HEAD~97

最佳答案

从根本上说,我不认为你可以,因为你有两个开发历史恰好产生相同的 HEAD 文件集。

我认为您需要:

  1. 丢掉你的 git 历史,从 perforce 导入:
    1. 使用 git-p4
    2. 或者使用 perforce-git 融合
    3. 在执行此操作之前,您可以手动编辑 perforce 历史记录,以包含来自 git 历史记录的尽可能多的详细信息。
  2. 丢弃您的 perforce 历史记录,并从 git 历史记录中重新创建(不确定这样做的最佳方式 - 这可能取决于您的 perforce 存储库中还有什么)。

关于git - 同步存在 git repo 与 p4 repo 并继续工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22349806/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com