Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

API equivalent of `git branch --no-merged master`

Hey folks,

 

Does the REST API have an easy way to list all branches that are not merged into a certain branch? Same as `git branch --no-merged master` on the command line..

 

I understand I can [list all branches](https://developer.github.com/v3/repos/branches/#list-branches) and then [compare](https://developer.github.com/v3/repos/commits/#compare-two-commits) the head commit of each one of them but it's not exactly the same and also requires as many extra API calls as many branches I have.

 

Thanks!

1 Reply
Community Manager
Message 2 of 2

Re: API equivalent of `git branch --no-merged master`

Thanks for reaching out.

 

No, there isn't an equivalent of the command you're describing in the REST API. The fastest way to get that information is via the technique you described or by cloning the repository locally and using the git command.

 

I hope that helps!