我正在使用JGit API(https://www.eclipse.org/jgit/)来访问git存储库.
在git存储库中,我也存储.txt文件和其他文件格式.我遇到了一个要求,我应该只得到.txt文件的差异.
基本上我试图达到相当于
git diff master HEAD -- '*.txt'
Run Code Online (Sandbox Code Playgroud)
如何根据文件扩展名过滤git diff?使用JGit API.
从这个答案,(相当于JGit中的git diff),我理解了如何获得正常的差异.但我想添加文件扩展名限制,但我在DiffCommand文档中看不到任何内容(https://download.eclipse.org/jgit/site/5.2.0.201812061821-r/apidocs/index.html).
有人可以给一些指针吗?