Search code examples
gitgitktig

Can Tig color commits of different branches differently?


In tig, I find it often hard to find out which commit belongs to which branch. In gitk, this is much more easier. I think this is because of two things. Firstly, gitk colors the branches differently (I mean the lines between commits) and secondly, it seems that the commits are sometimes place in a different "columns" (see pictures, btw git log --graph draws branches like tig).

Is there a way to color the blue stars or the pink lines drawn for each branch?

Gitk

Tig


Solution

  • Yes, tig shows the branch lines with different colors since version 2.0. Due to limitations in how lines can be drawn using text, a commit graph rendered in tig is often less compact than gitk. Compared to tig, gitk also uses other ways to reduce the "horizontal" width of the commit graph such as simply hiding branch lines in parts of the graph when they have no commits.

    The color of the commit "nodes" can be configured in tigrc by setting the graph-commit color. Example:

    color graph-commit green default
    

    example of colored commit graph