On GitHub, I can see the history of commits of a file under .../commits/master/filename
. What I want to know is, assuming these changes were merged into master
via Pull Requests, what Pull Request did the change come from? Is there an easy way to do that?
Asked
Active
Viewed 961 times
6

Old Pro
- 24,624
- 7
- 58
- 106
-
1Do you look for github-only (site) solution, or any git-related tool / console will be ok? – Lanorkin Aug 23 '14 at 06:37
-
https://webapps.stackexchange.com/a/104839/224355 – Graham Perrin Oct 23 '22 at 18:47
1 Answers
0
Since Oct. 13, 2014, this should be easier:
Linking merged pull requests from commits
We've been including the containing branches and tags on commit pages to give you more context around changes. Now, commits in a repository's default branch will also show you the pull request that introduced them.
In the pull request, you can see the discussion around why the commit was introduced, and get a clearer picture of the reason for the change.
As always, if you know the commit SHA, you can skip the commit page and search for the pull request directly.
For instance:
You can see for the file hakimel/reveal.js/plugin/markdown/markdown.js
, my contribution now comes with a reference to the PR #734 it originated.
Note however that:
- neither GitHub Get single commit API, like https://api.github.com/repos/hakimel/reveal.js/commits/f2097417daca80b2caaed2661ee646e861d789c8
- nor GitHub Get a commit API, like https://api.github.com/repos/hakimel/reveal.js/git/commits/f2097417daca80b2caaed2661ee646e861d789c8
will include the reference to the PR...