Why PhpStorm doesn't show my branches graph right?

Viewed 39

I have made two branches: master and test. In test branch I have two commit in my test branch and I expect to see two branches in my graph view, but I see one straight graph and seems it has one branch.

enter image description here

Also this is my git log:

enter image description here

1 Answers

This is a bit of a trick question, or riddle, but: When is a branch not a branch?

Possible answers:

  • When it's a twig.
  • When it's a trunk.
  • When it's in Git.

See also What exactly do we mean by "branch"?

The fact is that a Git commit graph is simply a Directed Acyclic Graph or DAG. It's possible to draw this DAG in many ways:

*   (test)
|
*
 \
  *  (master)
  |
  *
  |
  *

or:

A--B--C   <-- master
       \
        D--E   <-- test

or, indeed, as what you've just seen: a straight line with two labels on it. We could even draw it as:

         E   <-- test
        /
A      D
 \    /
  B--C   <-- master

if we like. All these drawings are the same, in the same way that a donut and a coffee cup are the same shape. (This explains why topologists' teeth are so bad. Also, read the comments under the video.)

(Although it's probably too late, the TL;DR is: your expectation is wrong.)

Related