Git merge base
git-merge-base
Find two commits common ancestor
Git
$ git merge-base oneCommit secondCommit
LibGit2Sharp
public string GetMergeBase(string a, string b)
{
using (var repo = new Repository("path/to/your/repo"))
{
var aCommit = Repository.Lookup<Commit>(a);
var bCommit = Repository.Lookup<Commit>(b);
if (aCommit == null || bCommit == null)
return null;
var baseCommit = Repository.Commits.FindMergeBase(aCommit, bCommit);
return baseCommit != null ? baseCommit.Sha : null;
}
}
Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
