如何使git diff显示与github的pull request diff相同的结果? [英] How to make git diff show the same result as github's pull request diff?

查看:331
本文介绍了如何使git diff显示与github的pull request diff相同的结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

分支合并后,github不再显示差异,但我尝试提出pull请求,但git diff仍会显示差异。

例如,我有分支D,在分支H上创建了修补程序,将H合并到了D,然后在D上创建了更多的东西。现在,git hub将reuqest从H移动到D显示没有区别,但git diff显示区别。



我试图做的是创建一个命令行工具来查看哪些旧分支(可能有很多)没有代码差异来开发。现在我必须去github,做一个pull reuqest并选择每个分支来查看是否有区别。



谢谢

解决方案

语法:

  git diff D ... H 

另见双点..之间的区别是什么?和三点...在Git diff commit ranges?


After branches are merged, and github no longer show difference when i try to make a pull request, but git diff will still show differences.

For example I have branch D, created hotfix on branch H, merged H to D, then created more stuff on D. Now git hub pull reuqest from H to D shows no difference but git diff H D show differences.

What I am trying to do is to create a commandline tool to see which old branches (there can be a lot) don't have code differences to develop. right now I have to go to github, do a pull reuqest and select each branch to see if there are difference.

Thanks

解决方案

You probably want the "triple-dot" syntax:

git diff D...H

See also What are the differences between double-dot ".." and triple-dot "..." in Git diff commit ranges?

这篇关于如何使git diff显示与github的pull request diff相同的结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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