My branching model for my project looks like this:
(source: https://www.bitsnbites.eu/a-stable-mainline-branching-model-for-git/)
I'm interested in knowing which release/*
branch most recently split from the ancestry of a given commit (HEAD
). For example, for the topmost master
commit, this would be release/v1.1
.
Is there a way to sort branches, e.g. with git branch --list release/* --sort=...
, so that I can find the most recent merge-base?
I can always loop through all the branches and call git merge-base HEAD {branch}
or something, but I'm curious if there is a way that's built in to git branch
.