问题描述:

Is there any way to show differences (on commits info) between two versions of pdf (or doc, odf) file? Now I can only download any version on it ("view raw" button).

网友答案:

PDF, DOC, and ODF files are binary formats, and don't contain plain text. Git doesn't really support human-readable diffs for binary files - it can generate binary diffs, but it won't make much sense without additional processing.

See this answer for more info handling binary diffs: http://stackoverflow.com/a/4705537/247763

As far as I know, the only binary format that GitHub can display diffs for is images. Image diffs are custom parts of GitHub that were written to compare the two different image versions in the repository, but this is not a native Git feature.

If you need to see the differences between two versions of a binary file, see what functionality the standard editor already has. Recent versions of Microsoft Word can display differences between two DOCX files, but that has to be performed on your machine only - not on GitHub.

网友答案:

You're still going to have to download the two PDF files to your computer. Even if you wrote an extension for chrome/firefox to view the diff in-browser, you'd still have to download the files.

As for doing the actual diff, you can try DiffPDF or the xdocdiff plugin for WinMerge.

If you want to view the diffs on the GitHub website, make a suggestion to GitHub to add that feature. The only way you can avoid downloading both PDFs is to have GitHub servers generate the diff.

相关阅读:
Top