gitgogo-git

Is it possible to git diff equivalent with go-git


I'm pulling a repo every 10 seconds and need to check what files have changed after each pull.

Is it possible to do this with go-git?


Solution

  • You can use the (*object.Commit).Patch method to diff two arbitrary commits. This provides information about which files where changed and what the differences were.