A command-line substitute for gitk

gitk is indispensable for viewing repo histories and understanding the relationships between different branches. However, using a GUI is a bit heavyweight if you are working remotely or only need to see the last few commits. Under these circumstances, git log --graph, introduced in git 1.5.6, is a pretty good fake.

My preferred invocation is

git log --graph --abbrev-commit --pretty=oneline --decorate

which I've aliased to gl in my shell.

The subsequent options, respectively: only show short commit names, for compactness; only display one line per commit, for compactness; and show where your branches are. Here's some sample output:

* f95f34e... (refs/remotes/origin/master, refs/heads/master) Acknowledge Alexey.
* c691bc7... Allow unmarking the marked commit.
* 7640638... Fixed visualization of marked commits
* c3830ed... Make it work better on Windows.  Thanks to Jeff Dik.
*   3433556... Merge commit 'fdr/sign-off'
|\  
| * 68344a2... Add signoff customization option
* |   3e29059... Merge commit 'cymacs/master'
|\ \  
| * | 45fb865... Fix incorrect diff hightlighting of lines beginning with "+" or "-".
| * | b7fe745... Disable undo in all magit-mode buffers.
| |/  
* | 10fe99a... Ambiguity in call to git log fixed
* | 3d34a7c... Make buffer saving behavior customizable.
* | 64b8265... Removed unused threshold machinery.
* | b430add... Make sure that point never ends up in an invisible region.
|/  
*   b30faeb... Merge commit 'voins/voins'
|\  
| * 7386af1... Use "medium" git log format when visiting commit
* | 5fb7327... Mention autogen.sh
* | f055b18... Typo.
|/  

3 comments:

  1. even better, and interactive too:

    http://jonas.nitro.dk/tig

    ReplyDelete
  2. or emacs magit

    ReplyDelete