Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
'git lg' instead of the default 'git log' (fredkschott.com)
55 points by fks on Feb 24, 2014 | hide | past | favorite | 23 comments


This is a rather linkbait-y title. "git log is so 2005... git log is where it's at!"

I actually thought that this was originally going to be an overview of tig[0] which has completely replaced git log for me.

[0] https://blogs.atlassian.com/2013/05/git-tig/


Tig is brilliant. Everything I ever needed from git log, easily accessible.


The visualization of branches becomes nigh pointless when you have a lot of disjoint developers in a codebase. Otherwise, I used to have this same setup.


Yeah, I've honestly largely given up on visual representations of branch history on real world repositories. You can make a lot more work for yourself trying to keep them sane, but the reality is you're just shoving a workload better suited to a computer into your own brain where it's frustrating and slow.

Better to learn how to do meaningful queries against the tree (is branch X in branch Y, what's the merge base of X, Y, Z, etc.) and let the computer understand it for you.

And usually what I want to see when I do git log these days is either --first-only on master or master.. on a topic branch.


> Beautiful, isn’t it?

With that transparent terminal? No. There's a massive distraction behind it.


Emacs Magit Mode:

[F2] g l l

http://www.emacswiki.org/emacs/Magit


I find git aliases to be essential. Things just become too unwieldy without them.

This is what my .gitconfig looks like right now: https://github.com/bilalq/dotfiles/blob/master/git/gitconfig


The title is so link-bait.


Terminal to modify repository data, SourceTree (or whatever GUI you want) to get your bearings. ;)

I hardly ever use git log anymore since SourceTree lets me know very easily who commited when, when and from what branch. What's not to love?


The --graph option is nice and cool looking but it gets incredibly slow with big repositories like the linux kernel, so I still use good old "git log" for that reason.


"Whether you love terminal customization or feel more Rand Paul with your ‘.bash_profile’, this tip will change your life."

wat?


I've tried these prettified `git log`s, but I always go back to the default: I prefer having the whitespace and everything being on a consistent column, instead of dancing all over the shop. But that's just me.


Git lol and git lola have been used for years, this is kind of a rehash of that.


I can't remember the last time I ran 'git log.'

Rather, I use tig to get a quick glance at commit history and staged / unstaged changes.

Can someone explain the relative upsides and downsides to using tig vs git lg?


First thing that comes to mind is that git lg is "included" with git.



It ain't pretty, but gitk will pop up a tkinter view on your current repo, with a graph and the ability to cherry-pick commits with the mouse.


http://alias.sh

has had these for a long time. both git lg and git gl


Saw this yesterday on Reddit, and been using it since, great improvement if you use command line git!


Something like this for mercurial?


This is the closest I could get to this when I was using Mercurial daily. Using the color extension:

  [color]
  custom.rev = red
  custom.bm = yellow
  custom.date = green
  custom.author = blue

  [alias]
  lg = log -G --template "{label('custom.rev',node|short)} - {if(bookmarks,'(')}{label('custom.bm',bookmarks)}{if(bookmarks,') ')}{desc|firstline} ({label('custom.date',date|age)}) <{label('custom.author',author|person)}>" -b .


There's also Steve Losh's CLI templates:

https://bitbucket.org/sjl/mercurial-cli-templates/overview


You get this for free if you use magit




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: