GIT合并发展成功能分支 - 在合并并恢复同一分支之后

发布于 2025-01-26 08:35:34 字数 246 浏览 6 评论 0原文

我的合并状况非常棘手,希望有人可以帮助我。

一段时间以前,将功能分支合并为发展。 由于发行不需要该功能,因此合并被恢复。 同时,将更多的特征分支合并为开发。

现在,是时候将同一功能分支重新合并到开发中了。 正如预期的那样,当我尝试这样做时,git会注意到我的更改已被删除,因此它会自动删除这些文件/更改,这些文件/更改是我本地功能分支机构中原始合并的一部分。

有没有办法解决此问题:合并/折叠发展到我的功能分支中,但要保留我所有的更改?

I am in a pretty sticky situation with a merge, I hope someone can help me.

A feature branch was merged into develop some time ago, all good.
Because that feature was not required for a release, the merge was reverted.
In the meantime some more feature branches were merged into develop.

Now, it is time to re-merge the same feature branch into develop.
As expected, when I try to do that, git will notice that my changes were deleted, so it automatically deletes those files/changes that were part of the original merge in my local feature branch.

Is there a way to fix this: merge/rebase develop into my feature branch, but keeping all my changes?

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

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

发布评论

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

评论(1

恋竹姑娘 2025-02-02 08:35:34

好的,这比我想象的要容易:

  • 更新的本地开发与git pull
  • cect ref rect revert with git log的ref recoped
  • 恢复了,git revert< ref_here> here> here>我的本地开发现在是git git
  • git checkout to我的功能分支机构,最终GIT合并。

Ok, it was easier than I thought:

  • updated local develop with git pull
  • found the ref of the revert commit with git log, copied
  • reverted that with git revert <ref_here>, my local develop is pre-revert now
  • git checkout to my feature branch, and finally git merge develop.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文