I'd like to check if a feature branch has been merged into my master branch using the github api/Octokit. I havent been able to find any documentation or posts on this topic. Is this possible? Does anyone know of any posts that address this topic?
Suppose you are on branch master and you want to check if the git merge origin/devel will work. Then just do: git merge-tree `git merge-base origin/devel master` master origin/devel . But this one line is way more powerful than it looks, because you can also do this on a branch that is not checked out.
objc. OctoKit has been extracted from GitHub for Mac by the Mac team and is a Cocoa and Cocoa Touch framework for interacting with the GitHub API, built using AFNetworking, Mantle, and ReactiveCocoa.
This is the equivalent to git log master..my-cool-branch
using Octokit - you want to see if there are any commits on your branch which are not in master
:
var head = "my-cool-branch";
var baseBranch = "master";
var compareBaseToHead = await client.Repository.Commit.Compare(owner, repo, baseBranch, head);
if (compareBaseToHead.TotalCommits == 0)
{
Console.WriteLine("Branch {0} has been merged into {1}", head, baseBranch);
}
else
{
Console.WriteLine("Branch {0} has NOT been merged into {1}", head, baseBranch);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With