在Github上查找提交最初创建的合并请求 [英] Find a Pull Request on Github where a commit was originally created

查看:637
本文介绍了在Github上查找提交最初创建的合并请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

合并请求非常适合理解围绕一个更改或对一个回购进行的一系列更改的更大想法。读取拉取请求是快速挖掘项目的好方法,因为您可以获得更大的逻辑更改分组,而不是对源进行小的原子更改。类似于将代码中的行组织到相关的节中,以便于阅读。



我发现自己正在查看文件或提交,并且我想知道是否有一种方法可以将提交回溯到最初创建它的合并请求。这个Pull请求最终会被合并,但在merge-commit时不是必需的。

解决方案

到github并在搜索栏中输入SHA,确保您选择左侧的问题链接。





通过Github UI,现在有一种非常简单的方法可以做到这一点。如果您正在查看UI中分支中的提交列表中的提交,请单击提交本身的链接。如果这个提交有一个PR,并且它没有直接添加到分支,则链接到PR列出了PR编号以及它进入的分支将直接位于页面顶部的提交消息之下。

i.stack.imgur.com/UrVGx.gifrel =noreferrer>



如果你有提交SHA而没有其他的东西,不想去挖掘它,只需添加 / commit / [commit SHA] 到repo url,你会看到提交页面,如果存在PR链接。
例如,如果SHA是52797a7a3b087231e4e391e11ea861569205aaf4且回购是 https://github.com/glimmerjs / glimmer-vm ,然后转到 https://github.com/glimmerjs / glimmer-vm / commit / 52797a7a3b087231e4e391e11ea861569205aaf4


Pull Requests are great for understanding the larger thinking around a change or set of changes made to a repo. Reading pull requests are a great way to quickly "grok" a project as, instead of small atomic changes to the source, you get larger groupings of logical changes. Analogous to organizing the lines in your code into related "stanzas" to make it easier to read.

I find myself looking at a file or a commit, and I wonder if there is a way to backtrack the commit to the Pull Request that originally created it. That Pull Request would have been merged eventually, but not necessary with a merge-commit.

解决方案

You can just go to github and enter the SHA into the search bar, make sure you select the "Issues" link on the left.

UPDATED 13 July 2017

Via the Github UI there is a now a really easy way to do this. If you are looking at a commit in the list of commits in a branch in the UI, click on the link to the commit itself. If there is a PR for that commit and it wasn't added directly to the branch, a link to the PR listing the PR number and the branch it went into will be directly under the commit message at the top of the page.


If you have the commit SHA and nothing else and don't want to go digging around for it, just add /commit/[commit SHA] to the repo url, and you will see the commit page, with the PR link if it exists. For example, if the SHA is 52797a7a3b087231e4e391e11ea861569205aaf4 and the repo is https://github.com/glimmerjs/glimmer-vm , then go to https://github.com/glimmerjs/glimmer-vm/commit/52797a7a3b087231e4e391e11ea861569205aaf4

这篇关于在Github上查找提交最初创建的合并请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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