Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can format your `git log` output to give you your network graph...

Really? Awesome. How?



This is the alias I use in my `.gitconfig` for running log with graphical output (got this somewhere, not sure where):

    [alias]
      l = log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%an]%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
The omglog gem is also useful for working with git. It gives you a graphical log of the entire repo (not just your current branch as a normal git log does), and it auto updates by monitoring for file system changes (OSX only).

To install:

    sudo gem install omglog
Then just run `omglog` in the root of your repo, or use this alias in your `.gitconfig` to automatically run it from the root of whatever repo you're in:

    [alias]
        omg = !omglog
(shell commands, starting with a "!" command in a git alias are always run from the root of a repository)


Stick this in your ~/.gitconfig

[alias]

  lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %C(bold white)%s%Creset %Cgreen(%cr) %C(blue)@%an%Creset' --abbrev-commit --date=relative
Then use from the cli as `git lg [branch1, branch2...]

Sourced from multiple results on google and customizations over time.





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

Search: