如何从Git拉取请求中看到所有修改过的文件? [英] How can I see all modified files from a Git Pull Request?

查看:105
本文介绍了如何从Git拉取请求中看到所有修改过的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与当前的master分支相比,我有兴趣查看在(GitHub)拉取请求中修改了哪些文件.

I'm interested in seeing which files have been modified in a (GitHub) pull request, compared to the current master branch.

如果无需在本地检出或更改文件就可以工作,那将是最佳选择-仅显示PR中已触摸过哪些文件(文件名,包括路径).

It would be optimal if this would work without checking out or changing files locally - just display which files (filenames including paths) have been touched in a PR.

这怎么完成?

推荐答案

我通常要做的事情:在github的pull请求页面上,您会在底部找到一个链接,上面写着"ProTip!Add .patch or.差异到Git的纯文本视图网址的末尾.". .patch的网址类似于:

What I do in general: on the github's page for the pull request, you will find at the bottom a link that says " ProTip! Add .patch or .diff to the end of URLs for Git’s plaintext views.". The url for the .patch looks something like:

https://github.com/git/git/pull/309.patch

(因此在命令行中,您可以简单地替换拉取请求号,而实际上不必每次都查看github页面).

(so from the command line you can simply substitute the pull request number, and don't in fact need to look at the github page everytime).

拥有此URL后,请使用类似以下内容的

Once you have this URL, use something like:

curl -s -L https://github.com/git/git/pull/309.patch | git apply --stat -

将显示类似于以下内容的输出:

which will show output similar to:

git-p4.py |   36 ++++++++++++++++++++++++++++++------
1 file changed, 30 insertions(+), 6 deletions(-)

这篇关于如何从Git拉取请求中看到所有修改过的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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