Is there a way to determine the parent branch of a branch other than comparing it to other branches? I have some branches that I created a while ago and I don't remember what I branched off of.
Asked
Active
Viewed 1,982 times
0
-
Branches do not have parent branches. See [How to find the nearest parent of a Git branch?](https://stackoverflow.com/q/3161204/1256452) – torek Dec 11 '20 at 07:23
-
Maybe my terminology isn't correct. Perhaps base branch is a better term. When you create a branch you "Create a branch based on..." That's the branch I would like to easily find. – Richard Dec 11 '20 at 18:48
-
Unfortunately, Git creates the new branch from a commit hash ID. If you give Git a branch name, it just resolves it immediately to the hash ID (try `git rev-parse
` to see how this works) and then forgets everything else: that name does not get recorded anywhere. The best you can do is to look at the hash ID in the branch name now, and the hash IDs of earlier commits, and the hash IDs of other branch names now, which is what the answers to the linked question do. – torek Dec 12 '20 at 01:26