How to detect what commit a branch has been created from in LibGit2Sharp
问题 So given an instance of LibGit2Sharp Branch how do you work out what commit that it was initially created from? 回答1: A Branch is merely an object depicting a git head reference. A head is a text file, mostly living under the .git/refs/heads hierarchy. This text file contains the hash of the commit this head currently points to. Similarly, a Branch bears a Tip property which points to a Commit . When working with git repositories and performing actions such as committing, resetting, rebasing..