git:发送合并请求恢复还原

发布于 2025-01-18 00:58:43 字数 885 浏览 7 评论 0原文

我曾在功能分支上工作,并发送了合并请求 随着以下提议,

feature-branch: A - B

有人错误地接受了它,而无需审查它,并且已在主人中合并。

同一个人在主人上应用了功能提交的恢复。

master: A - B- C (revert b) - D (revert a)

我一直在工作,并添加了一个新的提交,并在功能分支中使用一些次要细节,

feature-branch: A - B - E

如何在所有更改中发送合并请求?包括在恢复中删除的那些

它不起作用

,我尝试了我尝试按照 this ,但在功能分支中

$ git cherry-pick -x C
$ git cherry-pick -x D

。 :

 feature-branch: A - B - E - F (revert b) - G (revert a)

然后我应用了

$ git revert G
$ git revert F

结果:

 feature-branch: A - B - E - F (revert b) - G (revert a) - H (revert g) - I (revert f)

现在,当重新收集我的功能分支的合并请求时,我只将最后一个提交中的更改视为对主的差异。但是我看到所有的“恢复”都在提交细节上。

I have worked on a feature-branch, and I have sent a merge request
with the following commits

feature-branch: A - B

Someone accepted it by mistake, without reviewing it and it was merged in master.

That same person applied a revert commits of the feature commits on master.

master: A - B- C (revert b) - D (revert a)

I kept working and added a new commit with some minor details in feature-branch

feature-branch: A - B - E

How do I send a merge request with all the changes? including those that were removed in the revert

I have tried following this but it didn't work for me

In feature branch

$ git cherry-pick -x C
$ git cherry-pick -x D

The result:

 feature-branch: A - B - E - F (revert b) - G (revert a)

Then I applied

$ git revert G
$ git revert F

The result:

 feature-branch: A - B - E - F (revert b) - G (revert a) - H (revert g) - I (revert f)

Now, when resubmitting merge request from my feature-branch, I only see the changes made in the last commit as difference to master. But I see all "reverts" commits in the commits detail.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文