Given a specified branch, how do I find which branch it was branched from?
I know that Git doesn't actually support what most SCM's would call branches, so it's a question that is either difficult to answer, or in some cases perhaps doesn't even have an answer. Nevertheless our branching strategy (GitFlow) is branch heavy and therefore we commonly have a need to examine the 'branch' structure of the repository.
Given what I know of Git's lack of understanding of branches I frankly struggle to know how to even formulate the question in terms that make sense in Git.
I do know that it's possible to determine which branch 'contains' another using git branch --contains <commit>
so perhaps one Git-like way to formulate the question would be, "how do I determine the first ancestor commit of a branch that is included in at least one other branch that contains the specifed branch?"
I'm not completely sure that's the right question, but it's the best I can do.
I'm looking for a solution that is robust in the face of the branch having synchronisation merges from its parent into itself, or being merged back into its parent.
I'm also looking for a solution that's at least somewhat user friendly, ideally a single Git command or a TortoiseGit gui approach, rather than a BASH or Python script.