It's possible to obtain the number of commits behind/ahead using git rev-list
command. I am trying to achieve the same thing using libgit2sharp
library but the library is not fully documented so I couldn't find how to.
I'm looking for an example for obtaining behind/ahead commit numbers with libgit2sharp
.
Branch.TrackingDetails
property, which behind the scene uses theHistoryDivergence
class that Jason Haslam is refering to in his answer. – Damnation