从 git、git-p4 中不相关的存储库移动提交
我一直在学习 git 和 git-p4,但最终陷入了无法再“git-p4 提交”的情况;补丁不能完全应用。
我总是可以重新克隆 p4 仓库并在顶部复制我的新更改和“git-p4 提交”,但我想在新的 git 存储库中维护我的提交历史记录。鉴于新旧存储库从相同的状态开始,是否有一种方法可以将提交从旧存储库转移到新存储库,即使新存储库不是从旧存储库“git克隆”的?
I've been learning git and git-p4 and have ended up in a situation where I can't 'git-p4 submit' anymore; patches don't cleanly apply.
I can always re-clone the p4 depot and copy my new changes over the top and 'git-p4 submit', but I'd like to maintain my commit history in the new git repository. Given that the old and new repositories start from an identical state, is there a way of moving commits from the old to the new, even thought the new wasn't 'git clone'd from the old?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试查看 git 移植,看看你是否可以合并两个历史记录(一个大的在你的 git 存储库中,一个新的短的,来自新的 p4 克隆)
你在问题“如何将历史记录添加到 git 存储库中?"
You could try and look into git grafts, to see if you can merge the two history (one large in your git repo, and the new short one, from a new p4 clone)
You have more details in the question "How do I prepend history to a git repo?"