Reputation: 413
Say I have a repo in github, and someone issues a PR. It is there anyway to check if PR is made, and what is the difference with my origin branch using git from terminal?
Upvotes: 0
Views: 1673
Reputation: 136936
GitHub's pull requests are built on top of Git's native refs system. As outlined in the GitHub help page checking out pull requests locally, it is possible to fetch
pull requests to your local machine:
Manually modify the .git/config
file in your repository to add a new fetch
line to whatever your GitHub remote is called (if you don't know, this is probably origin
):
[remote "origin"]
url = [email protected]:<USERNAME>/<REPO_NAME>.git
fetch = +refs/heads/*:refs/remotes/origin/*
# Add this new line:
fetch = +refs/pull/*/head:refs/pull/origin/*
Now fetch
from your remote:
git fetch origin
Check out a pull request:
git checkout pull/origin/123
This will let you compile / test the pull request and decide if you wish to accept it using GitHub's web UI.
Upvotes: 3
Reputation: 241858
Check the commands pulls
and pull-diff
at https://github.com/ingydotnet/git-hub. It makes the GitHub API accessible easily from bash.
Upvotes: 1