While working on a branch that I've opened a pull request on, I would like to see the exact same diff that GitHub displays on the commandline. What is the particular git diff command that replicates the list of changes GitHub displays for a pull request?
相关问题
- How to add working directory to deployment in GitH
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
相关文章
- 请教Git如何克隆本地库?
- java开发bug问题:GitHub授权登录无法获取授权账号信息?
- Is there a Github markdown language identifier for
- “no implicit conversion of Integer into String” er
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
See the Reviewing and Synchronising section in GitHub advanced training. In particular, after fetching the pull request you can view the diff prior to merging:
If you don't want to do any git fetch and update a local PR branch, you simply can use cli/cli, the command-line interface for GitHub.
The release 0.9.0 includes
gh pr diff
Not sure if there is a way to get the actual diff format closer to Github style but
$ git diff master...<branch_name>
seems to show the set of changes that a pull request would show (assuming it's a pull request againstmaster
). The list of changed files in a pull request seems to be equivalent to$ git diff --name-status master...<branch_name>
. I guess this all assumes that your local branches are up-to-date with the remote Github branchesgit diff branchA branchB
should work, no?More info on other perhaps useful diff notations can be found here
The closest thing is to diff with the common ancestor between your feature-branch and your base-branch.
Something like: