After running a repo.Network.Pull()
command I want to be able to see what files were added to the repository, altered in the repository and removed from the repository. All I need is the file path of the file and if it was an add/update or a delete.
Is there an easy way to do this? I've tried looking into Diff.Compare()
but I'm not sure if that is the right way to do it.
LibGit2Sharp 0.21.0.176
Here is an libGit2 example of walking your current commit tree and getting the files that changed and the type of change.
Git version:
libGit2 version:
Output:
In directly answering to your question, just grab the first commit from the Commits enumerator and compare its tree to its parents (could be more than one parent due to a merge) vs. my example of looping all the commits in the current branch.