Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub pull request id from commit hash

How can I get GitHub PR id from commit hash? It is possible in git console or GitHub API?

like image 992
Josué Henrique F. da Silva Avatar asked Aug 11 '17 12:08

Josué Henrique F. da Silva


People also ask

How do I find my GitHub pull request ID?

To get the PR ID you will need to use the GitHub Search Issues API and first find the PR number and then you can use the PR number to find the PR id. Take note that a pull request will have a Pull Request ID and a separate Issue ID. Step 2: Use the PR number and repo details to find the PR ID.

How do I display commit hash?

# open the git config editor $ git config --global --edit # in the alias section, add ... [alias] lastcommit = rev-parse HEAD ... From here on, use git lastcommit to show the last commit's hash. Save this answer.

Is pull request same as commit?

A commit is a discrete change to one or more files. It is a critical part of Git. A pull request is a request to merge one or more commits into a different branch. It is not part of Git; it is only part of GitHub (and similar services like BitBucket).


1 Answers

The commit SHA for example is: 7dd1bcf5f2f5eeed34cc2ec63053098fba302b6c

  1. Go to the "Pull requests" tab
  2. In the filter enter: is:pr is:closed 7dd1bcf5f2f5eeed34cc2ec63053098fba302b6c

If the PR is not closed then remove is:closed

like image 68
Googol Avatar answered Sep 23 '22 05:09

Googol