git 未显示大型 github 提交差异

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9702795/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 06:36:01  来源:igfitidea点击:

Large github commit diff not shown

gitgithubdiff

提问by ryan

This happens to me both with Compare view as well as standard commits that are large in the amount of files changed.

这发生在我身上,比较视图以及更改文件数量很大的标准提交。

The screenshot below is from a compare between two branches with 380 files changed. The files at the beginning of the diff log have their diffs visualized but at a certain point down the page it stops visualizing the diffs. I understand you don't want massive pages but I can't seem to find a way to view a file's diff individually. Instead I have to check these both out locally and do the diff manually.

下面的屏幕截图来自两个分支之间的比较,其中更改了 380 个文件。差异日志开头的文件具有可视化的差异,但在页面下方的某个点,它停止可视化差异。我知道您不想要大量页面,但我似乎无法找到单独查看文件差异的方法。相反,我必须在本地检查这些并手动进行差异。

Does anyone have a simpler solution whether it be software driven or (preferably) a link i'm missing on github?

有没有人有更简单的解决方案,无论是软件驱动还是(最好)我在 github 上丢失的链接?

Diff screenshot

差异截图

回答by Simon Lindholm

Adding .patchto the end of the URL somewhat helps. Removes the nice UI and comment functionality, of course.

添加.patch到 URL 的末尾有些帮助。当然,删除了漂亮的 UI 和评论功能。

An example. If your pull request is: https://github.com/JustinTulloss/zeromq.node/pull/47, then the patch can be found at https://github.com/JustinTulloss/zeromq.node/pull/47.patch

一个例子。如果你的拉取请求是:https://github.com/JustinTulloss/zeromq.node/pull/47,那么补丁可以在https://github.com/JustinTulloss/zeromq.node/pull/47.patch找到

回答by sjakubowski

Official support answer as of Feb 19th / 2013 via Brian Levin @github.

截至 2013 年 2 月 19 日,官方支持答案来自 Brian Levin @github。

We have some limits on diffs that we show in the browser in order to keep the pull request and compare pages working. Currently, we cut them off at 300 files, a total diff of 1MB, and an individual diff of 100KB.

If your diffs exceed the limits and can't be viewed online, you can always pull the changes locally and view the diff there. It may not be as convenient for you, but it'll get the job done.

我们对在浏览器中显示的差异有一些限制,以保持拉取请求和比较页面的工作。目前,我们将它们截断为 300 个文件,总差异为 1MB,单个差异为 100KB。

如果您的差异超出限制并且无法在线查看,您可以随时在本地提取更改并在那里查看差异。这对您来说可能不太方便,但它可以完成工作。

回答by idlethread

This sounds like a bug on github. But you could see similar statistics using git diff on the command-line. And if you really want a graphical tool, perhaps installing something like meld would help.

这听起来像是 github 上的一个错误。但是您可以在命令行上使用 git diff 看到类似的统计信息。如果你真的想要一个图形工具,也许安装像 meld 这样的东西会有所帮助。

git config --global diff.tool meld
git difftool master..devel

回答by CrimsonX

The best local comparison I've found to use is to use IntelliJ's built in comparison. Adding comments is a pain, but everything else works well. Perform the following steps:

我发现使用的最好的本地比较是使用 IntelliJ 的内置比较。添加评论很痛苦,但其他一切都很好。执行以下步骤:

  1. Identify the file you're interested in, say "myClass.java"
  2. Pull the latest from your develop and your branch, call it compare_branch
  3. checkout the latest by git checkout compare_branch
  4. Open IntelliJ, and use double-shift completion to search for the file you need to look at, e.g. shift-shift myclass.javato navigate to it.
  5. In IntelliJ's menu, select VCS -> Git -> Compare with branch -> developreplace developwith whatever you want to compare against.
  1. 确定您感兴趣的文件,说“myClass.java”
  2. 从你的开发和分支中提取最新的,称之为 compare_branch
  3. 结帐最新的 git checkout compare_branch
  4. 打开 IntelliJ,并使用双移完成来搜索您需要查看的文件,例如shift-shift myclass.java导航到它。
  5. 在 IntelliJ 的菜单中,选择VCS -> Git -> Compare with branch -> develop替换develop为您想要比较的任何内容。

Hope this helps someone else.

希望这对其他人有帮助。

回答by 3limin4t0r

I had the same issue. If you're looking to keep with the browser experience I've found the following solution:

我遇到过同样的问题。如果您希望保持浏览器体验,我找到了以下解决方案:

Open your JavaScript console and execute:

打开你的 JavaScript 控制台并执行:

document.querySelectorAll('button.load-diff-button').forEach(button => button.click());

This will freeze the page since all click events are fired at the same time. Have some patience and everting will be loaded. Obviously if the document structure changes one might need to update the above statement.

这将冻结页面,因为所有点击事件都被同时触发。有一些耐心,外翻将被加载。显然,如果文档结构发生变化,则可能需要更新上述语句。

回答by mohd.akram

If you know which file or directory you want, you can use the GitHub File Diff extension, available for Chromeand Firefox.

如果你知道你想要哪个文件或目录,你可以使用 GitHub File Diff 扩展,可用于ChromeFirefox

Disclaimer: I made this extension.

免责声明:我做了这个扩展。