Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有等效于git diff FILEin的功能libgit2?换句话说,如何有效地检索单个文件的差异,而无需libgit2查看工作目录中的其他文件?
git diff FILE
libgit2
git diff FILE将显示您对索引所做的更改。
这可以通过使用 libgit2git_diff_index_to_workdir()函数来实现。
git_diff_index_to_workdir()
此函数接受一个git_diff_options结构作为参数,您可以在其中提供您特别感兴趣的路径规范或路径规范列表。
git_diff_options
有关此的更多信息: