git 失败时尽可能应用补丁

发布于 2024-09-26 15:06:33 字数 251 浏览 1 评论 0原文

我正在从一个存储库转移到另一个存储库,并且需要移植一些更改。目录结构大部分相同,但文件并不完全相同。

我使用“git format-patch”和“git am”或“git apply”来移植这些更改。当它工作时,生活是美好的,但是当它因为一些微小的更改或文件丢失而失败时,什么都不会应用。

我可以使用 --exclude 过滤掉文件,但我真正想要的是它尽可能地应用,并告诉我哪里存在冲突/失败。

我也愿意接受其他应用补丁或类似内容的选择。

I am moving from one repository to another and need to port some of the changes. The directory structure is mostly the same but the files not all identical.

I am using 'git format-patch' and 'git am' or 'git apply' to port those changes. When it works, life is good, but when it fails because of some minor change or files missing, nothing gets applied.

I can filter files out using --exclude, but what I really would like is that it applies as much as it can and just tell me where there are conflicts / failure.

I am also open to other option for applying the patches or things like that.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

九八野马 2024-10-03 15:06:33

--reject 选项可能就是您正在寻找的。这样,您将获得失败块的经典 .rej 文件,而所有好的块都将被应用。

The --reject option is probably what you're looking for. With that, you'll get classic .rej files for failing chunks, while all the good chunks will be applied.

奶茶白久 2024-10-03 15:06:33

您也可以尝试 git apply --3way 。

You could also try git apply --3way.

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