我正在尝试显示一个文件的两次提交之间的gitdiff。基本上,我是按照https://github.com/centic9/jgit-cookbook/blob/master/src/main/java/org/dstadler/jgit/porcelain/ShowChangedFilesBetweenCommits.java那样做的您可以在https://github.com/svenhornberg/JGitDiff下查看我的完整代码publicclassRepoDiff{publicvoidcompare(byte[]fileContentOld,byte[]fileConte