I got back on an old project and I ran the nice git status to figure out what was going on and I noticed way too many branches! I want to do some housekeeping before starting to work on this again but I’m not sure which branch comes from which..
E.G. Does “branchA” derive from “develop”? Does “branchB” derive from “master” or “branchA”??
How can I answer the sample questions above?
There’s no canonical answer for this, since branches are simply pointers to certain commits in a DAG. For instance,
masterandfoocould be pointing at the same commit; if you then create a branch fromfoo, it’s effectively the same as creating a branch frommaster.That said, if you visualize the commit graph (via
gitkor some other graphical history tool), you can get a general sense of where the branch points are in the commit graph, versus where various branch pointers are pointing.