从 git、git-p4 中不相关的存储库移动提交

发布于 2024-08-12 02:21:53 字数 197 浏览 3 评论 0原文

我一直在学习 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愛放△進行李 2024-08-19 02:21:54

您可以尝试查看 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?"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文