GitHub 拉取请求显示已在目标分支中的提交 [英] GitHub pull request showing commits that are already in target branch

查看:35
本文介绍了GitHub 拉取请求显示已在目标分支中的提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 GitHub 上的拉取请求审查到非主分支.目标分支在 master 后面,pull request 显示来自 master 的提交,所以我合并 master 并将其推送到 GitHub,但刷新后它们的提交和差异仍然出现在 pull request 中.我已经加倍检查了 GitHub 上的分支是否有来自 master 的提交.为什么它们仍然出现在拉取请求中?

我还在本地检查了拉取请求,它只显示未合并的提交.

解决方案

看起来 Pull Request 没有跟踪目标分支的更改(我联系了 GitHub 支持,并在 2014 年 11 月 18 日收到了回复,说明了这一点是设计使然).

但是,您可以通过执行以下操作使其显示更新的更改:

http://githuburl/org/repo/compare/targetbranch...currentbranch

githuburlorgrepotargetbranchcurrentbranch 替换为需要.

或者正如 hexsprite 在他的回答中指出的那样,您也可以通过单击 PR 上的 Edit 并暂时将基础更改为不同的分支并再次返回来强制更新.这会产生警告:

<块引用>

您确定要更改基数吗?

来自旧基础分支的一些提交可能会从时间线,旧的评论意见可能会过时.

并且会在 PR 中

I'm trying to review a pull request on GitHub to a branch that isn't master. The target branch was behind master and the pull request showed commits from master, so I merged master and pushed it to GitHub, but the commits and diff for them still appear in the pull request after refreshing. I've doubled checked that the branch on GitHub has the commits from master. Why are they still appearing in the pull request?

I've also checked out the pull request locally and it only shows the un-merged commits.

解决方案

It looks like the Pull Request doesn't keep track of changes to the target branch (I contacted GitHub support, and received a response on 18 Nov 2014 stating this is by design).

However, you can get it to show you the updated changes by doing the following:

http://githuburl/org/repo/compare/targetbranch...currentbranch

Replace githuburl, org, repo, targetbranch, and currentbranch as needed.

Or as hexsprite pointed out in his answer, you can also force it to update by clicking Edit on the PR and temporarily changing the base to a different branch and back again. This produces the warning:

Are you sure you want to change the base?

Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.

And will leave two log entries in the PR:

这篇关于GitHub 拉取请求显示已在目标分支中的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆