如何在 Bitbucket 的远程分支中合并(git rebase)多个提交

发布于 2025-01-14 13:38:09 字数 779 浏览 3 评论 0 原文

我被要求合并 BitBucket 中远程分支中的多个提交。 输入图片此处描述 最后两次和前三个提交是由不同的人贡献的。

我看过一些 YouTube 视频,但仍然不知道如何做到这一点。以下是我所做的:

在本地分支中运行此命令

git rebase -i HEAD~5

在此处输入图像描述

然后

git push :; -f

一旦我推送这个,我的拉取请求就会被拒绝。如果我尝试重新打开拉取请求,我将看到以下错误消息: 输入图片这里的描述

有人知道如何组合一堆提交吗?

I am asked to merge multiple commits in a remote branch in BitBucket.
enter image description here
The last two and first three commits are contributed by different people.

I have watched some YouTube videos, but still cannot figure out how to do this. Below is what I did:

Run this command in a local branch

git rebase -i HEAD~5

enter image description here

And then

git push <local_branch>:<remote_name> -f

Once I push this, my pull request gets declined. If I try to re-open my pull request, I will see this error message:
enter image description here

Does anyone know how to combine a bunch of commits?

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

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

发布评论

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

评论(1

顾挽 2025-01-21 13:38:09

您是否尝试过从最新版本的远程分支重新建立分支?貌似这就是拒绝的理由?

Have you tried rebasing your branch from the latest version of the remote branch? Looks like that's the reason for the rejection?

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