git 将 github diff 更改为并排比较?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15048958/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Change github diff to be side by side comparison?
提问by Adam Lee
For github web browsing, it is not shown as side by side as lots of diff tool does. Can I change the diff mode to side by side? I mean on the github web.
对于 github 网页浏览,它不像许多差异工具那样并排显示。我可以将差异模式更改为并排模式吗?我的意思是在 github web 上。
采纳答案by VonC
Yes, it is possible since Sept. 3rd 2014: see "Introducing split diffs":
是的,自 2014 年 9 月 3 日起就有可能:请参阅“介绍拆分差异”:
Diffs now come in two flavors, unified and split.
Switch between them on pull request, commit, and compare pages using the toggle in the top right of the page. The mode you last used will become your preferred default.
差异现在有两种风格,统一和拆分。
使用页面右上角的切换按钮在拉取请求、提交和比较页面之间切换。您上次使用的模式将成为您的首选默认模式。
Note: since Sept. 4th 2014, it also support word diff highlights.
See "Does Github have a view that shows diffs between file versions?".
注意:自 2014 年 9 月 4 日起,它还支持word diff highlight。
请参阅“ Github 是否有显示文件版本之间差异的视图?”。
回答by huyz
You can with Octosplit Chrome extension. But you don't get the full length.
您可以使用Octosplit Chrome 扩展程序。但是你没有得到完整的长度。
回答by mvp
Not git diff
, but you can use git difftool
, which will call appropriate utility for your platform to do just what you are asking for.
不是git diff
,但您可以使用git difftool
,它会为您的平台调用适当的实用程序来完成您的要求。
For example, in Linux it will call meld
by default, which is very nice tool. git difftool
knows about quite a few diffing utilities, but you can also configure it to call your own.
例如,在 Linux 中它会meld
默认调用,这是一个非常好的工具。git difftool
了解不少不同的实用程序,但您也可以将其配置为调用您自己的实用程序。
回答by Ivan Zuzak
Nope, not possible on GitHub at the moment. You can check out other on-line diff tools, such as: http://www.quickdiff.com/, http://www.diffchecker.com/and http://www.diffnow.com/. These will give you side-by-side diffs, but you have to copy/paste text manually.
不,目前在 GitHub 上不可能。您可以查看其他在线 diff 工具,例如:http://www.quickdiff.com/、http://www.diffchecker.com/和http://www.diffnow.com/。这些将为您提供并排差异,但您必须手动复制/粘贴文本。
回答by ymattw
Github web does not have the feature yet.
Github web 还没有这个功能。
You might be interested in term based diff tool cdiff, it has an option -s
to yield side-by-side diff.
您可能对基于术语的差异工具cdiff 感兴趣,它可以选择-s
生成并排差异。
To view changes not submitted yet, type
要查看尚未提交的更改,请键入
cdiff -s
To view change history in your workspace, type
要查看工作区中的更改历史记录,请键入
cdiff -ls
To view changes from a pull request, pipe in the raw diff from the url, for example:
要查看拉取请求的更改,请从 url 输入原始差异,例如:
curl https://github.com/ymattw/cdiff/pull/11.diff | cdiff -s
回答by Tom Dalton
Looks like it can do it as of version 1.7.9: https://raw.github.com/gitster/git/master/Documentation/RelNotes/1.7.9.txt
看起来它可以从 1.7.9 版开始:https: //raw.github.com/gitster/git/master/Documentation/RelNotes/1.7.9.txt