Search code examples
gitmagit

Git alias to include time similar to magit


I use the following alias which I like a lot:

git config --global alias.dag 'log --oneline --decorate --all --graph'

It gives me something link this:

* 1234  (HEAD->master, origin/master) Commit Message

When I use emacs magit I also get the user name and date of commit:

* 1234  (HEAD->master, origin/master) Commit Message    MyName   date

Anyone know the best way to modify the alias to provide the extra information? It would also helped if it was column aligned like emacs does.


Solution

  • This works great, thank you guys for the great start:

    git config --global alias.dag 'git log --pretty=format:"%C(blue)%h %C(green)%d %<(60)%Creset%s %<(20)%C(yellow)%cn %C(green)%ad" --decorate --all --graph --date=local'