简体   繁体   English

使用p4 repo同步存在git repo并继续工作

[英]Sync exists git repo with p4 repo and continue working

How can I sync my git repos (with own history) to p4 repo (with own history) but files in this repos on HEAD is the same. 如何将我的git repos(具有自己的历史记录)同步到p4 repo(具有自己的历史记录),但是HEAD上此repos中的文件是相同的。

I do 我做

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

Got this graph 得到了这张图 图形

What should I do next ? 接下来我该怎么办?

Also When I do 当我这样做的时候

git p4 rebase

I have got this error fatal: Not a valid object name HEAD~97 我有这个错误致命:不是有效的对象名称HEAD~97
Command failed: git cat-file commit HEAD~97 命令失败:git cat-file commit HEAD~97

Fundamentally I don't think you can, as you have two development histories which happen to produce the same HEAD set of files. 从根本上说,我不认为你可以,因为你有两个开发历史,恰好生成相同的HEAD文件集。

I think you'll need to either: 我想你需要:

  1. Throw away your git history, and import from perforce: 抛弃你的git历史,并从perforce导入:
    1. With git-p4 用git-p4
    2. Or with perforce-git fusion 或者使用perforce-git融合
    3. Before doing this you can edit the perforce history manually to include as much detail as possible from the git history. 在执行此操作之前,您可以手动编辑perforce历史记录,以便从git历史记录中包含尽可能详细的信息。
  2. Throw away your perforce history, and recreate from the git history (not sure of the best way of doing this - it may depend what else is in your perforce repository). 抛弃你的perforce历史,并从git历史中重新创建(不确定这样做的最佳方式 - 它可能取决于你的perforce存储库中的其他内容)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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