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.
|/  

11 comments:

  1. even better, and interactive too:

    http://jonas.nitro.dk/tig

    ReplyDelete
  2. or emacs magit

    ReplyDelete
  3. F*ckin¦ amazing issues here. I am very satisfied to see your post. Thank you a lot

    ReplyDelete
  4. I appreciate it for your efforts. You should keep it up forever! Best of luck.

    ReplyDelete
  5. Hello, I enjoy reading all of your article. I like to write a little comment to support you.

    ReplyDelete
  6. As a Newbie, I am always browsing online for articles that can aid me. Thank you

    ReplyDelete
  7. The way you have described everything is phenomenal.

    ReplyDelete
  8. Its an amazing website, I really enjoy reading your articles.

    ReplyDelete
  9. I am hoping to check out the same high-grade content from you in the future as well.

    ReplyDelete
  10. Aw, this was an extremely nice post.

    ReplyDelete