When you merge branches, you can be confused by the output git log
gives you sometimes.
The main issue is that by default git log
use chronological order and not topological order --topo-order
, which is
the order of the commits when they appeared on their respective branch. This is disturbing to me.
Look at it by youself:
The idea is to replace your daily use of git log
with git l
that use the --topo-order
option.
With colors and a nice column display
Give a better historical display. They use the option --graph
which respect the topological order by default.
With all references (not the most useful but can help sometimes)
List your branch by date in reverse order
Here are the lines to add to your .gitconfig:
[alias]
l = log --topo-order --format='%<(50,trunc)%s %<(11,trunc)%C(green)%an %<(14,trunc)%C(cyan)%cr %C(reset)%h'
lg = log --graph --format='%<(50,trunc)%s %<(11,trunc)%C(green)%an %<(14,trunc)%C(cyan)%cr %C(reset)%h %C(yellow)%d'
lga = log --graph --format='%<(50,trunc)%s %<(11,trunc)%C(green)%an %<(14,trunc)%C(cyan)%cr %C(reset)%h %C(yellow)%d' --all
b = for-each-ref --sort=committerdate refs/heads/ --format='%(color: cyan)%(committerdate:relative) %(color: yellow)%(refname:short)'
# you might also like:
s = status
co = checkout
fp = push --force-with-lease
I hope this is useful to some of you out there.