Download Github pull request as unified diff

烈酒焚心 提交于 2019-11-29 19:03:47
Simone Carletti

To view a commit as a diff/patch file, just add .diff or .patch to the end of the URL, for example:

Somewhat related, to let git download pull request 123 and patch it into mylocalbranch locally, run:

git checkout -b mylocalbranch
git pull origin pull/921/head

To get the PR changes into your local repo in an staged but uncommitted state, so you can review:

git pull origin pull/123/head --no-commit

And to generate a patch file from that:

git diff --cached > pr123.diff    
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!