GitHub Pull Request 显示来自 master 的一些提交

埃内斯蒂娜·胡安

我目前有一个开放的拉取请求。我首先进行了一次提交,然后 repo 所有者请求对其进行更改,然后我推送了第二次提交。

但是在推送第二次提交时,项目主分支不断更新,所以我决定对我的拉取请求分支进行 rebase。

现在我的拉取请求显示了我的第一次提交,然后是来自 repo master 分支的其他人的其他提交,然后是我的第二次提交。

问题是:如何从 master 分支中删除这些提交并只保留我所做的两个提交?

谢谢你。

拉尔斯克

我怀疑您的问题是您的拉取请求似乎包含合并提交。这不是您在 PR 中通常想要的,它通常应该是目标分支(通常是master之上的一组线性更改合并带来了额外的提交。

查看您的 PR,我看到以下提交似乎是您打算提交的:

42a310e [email protected] Merge branch 'autodarkmodeambient' of https://github.com/fercarcedo/Signal-Android into autodarkmodeambient
1678038 [email protected] Refactored automatic dark mode and solved possible memory leaks
a8ba129 [email protected] Fixed race condition, memory leak and improvements
b194a83 [email protected] Automatic dark mode based on ambient light

如果您删除合并提交...

git reset 1678038

...然后重新提交拉取请求:

git push -f

你最终会得到一个更干净的提交。你可以在这里看到它的样子:

这里的教训是“不要将事物合并到您的功能分支中”。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Github为什么在每个Pull Request中显示我以前的所有提交

如何使git diff显示与github的pull request diff相同的结果?

如何使用GitHub API确定提交属于哪个Pull Request?

Github pull request builder 的 Pull request Webhook 支持哪些“动作”?

如何在 GitHub 上使用来自其他人的 pull request 的代码?

Git:只对master提交一些更改

为什么“git pull origin feature-12345 master”是更新我的 pull request 分支的唯一方法?

获取对github pull request的最后推送日期

如何使用curl创建Github Pull Request?

为什么 Github Pull Request 的基本分支文件(左侧)显示的内容与 HEAD 版本不同?

由 Jenkins 中的 GitHub Pull Request Builder 插件发送的提交状态中的 Blue Ocean URL

github上的私人项目上的git pull origin master

无法使用Jenkins GitHub Pull Request Builder更新GitHub PR

Github Pull Request API与网络工作流程不同

如何在github上自动合并pull request?

Github将pull_request的钩子发送到AmazonSNS

无法让Jenkins更新具有构建状态的GitHub Pull Request

如何在Jenkinsfile中设置github pull request构建?

SonarQube github pull request 插件删除我的评论

下游Jenkins GitHub Pull Request Builder的正确配置

触发GitHub Pull Request的Visual Studio Team Services构建

在詹金斯的github pull request中添加评论

在Github Pull Request中生成行指针URL

Jenkins和Github Enterprise 2.17仅失败的Pull Request构建

使用GitHub Pull Request Builder触发多个Jenkins构建

Github Pull Request:没有什么可比较的

对于从公共 GitHub 存储库引用的包,Npm install on GitHub Pull Request 失败

Github Pull Request Builder-无法触发构建并且无法在github commit上设置构建状态

区别github合并“ pull-request”和gitlab合并“ merge-request”