What exactly does each line in the graph represent?

jrood June 24, 2014

I work with a team of developers developing enterprise applications, and we have used source tree with Git for about half a year now. However, we still can't seem to figure out exactly what each line in the graph represents? Is each line one branch? If so, which color corresponds to which branch? Why is there no key?

2 answers

1 accepted

1 vote
Answer accepted
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 24, 2014

In general, each line is one branch. Keep in mind that working in a team environment will often create multiple branches with the same name (in the graph). For example, my repository's "master" is a different branch than my coworker's "master". As long as we are staying in sync, these will be displayed together, but if the two of us make commits simultaneously, someone has to merge, and the "master" branch will temporarily diverge to reflect that activity (unless the merger uses rebase, which rewrites their history to make it appear as if the branch did not diverge).

Colors are arbitrary, intended only as a visual aid when scrolling through the history. It seems that Sourcetree cycles through a fixed sequence of colors, starting with blue for the most recently touched branch.

I believe the reason this gets so confusing is because the distributed nature of Git makes a commits membership in any particular branch much more ambiguous that for a centralized system like SVN.

1 vote
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 25, 2014

Just for completion:

Look at my comment here:

https://answers.atlassian.com/questions/310287/how-to-know-which-branch-color-correlates-with-which-branch

I tried to explain there, that the git-log view isn't static.

Is each line one branch? ... Why is there no key?

Yes - and no. You are able to delete branches in git - this means mainly that the branch name is deleted while the commits on the branch still remain. Within the git-log view the commits on the deleted branch are still represented on a separate line - unless the branch does not exist anymore. So each line represents an existing or (maybe) deleted branch - therefore there is no key for the lines (as the branch may be deleted).

What the gil-log view really represents is a topological view on the commits rather than a branch overview. It displays things like "the parent of commit x is commit w" (in case of straight development) or "commit a has two children: commit b and commit c" (in case of branching where commit b lives on branch 1 and commit c lives on branch 2) or "commit i has two parents" (in case of merges) ...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events