4

Often I use "git log --graph --all --decorate --online" command.

It's verbose and tedious to write it with all the parameters. I know that i want these options always be applied to my git log cmd.

edit:i want only git to change its behavior - not writing some script outside of it, tweaking win shell or smth! I want to write "git log" and it does

"git log --graph --all --decorate --online" automatically

Like in vim, there is probably some default config file?

ERJAN
  • 23,696
  • 23
  • 72
  • 146

1 Answers1

5

You can create aliases in ~/.gitconfig file.

Basically, add the following to your .gitconfig:

[alias]
     llog = log --graph --all --decorate --online

Now when you call git llog, it will execute git log --graph --all --decorate --online

For furhter information read this.

fcat
  • 1,251
  • 8
  • 18
  • so "git log" is bound forever to just one default behavior? i can't change it? but i can create alias? – ERJAN Sep 28 '17 at 11:11
  • I am not sure about that. But even if it is possible, I think using alias is safer – fcat Sep 28 '17 at 11:21
  • 1
    great works fine , my productivity will probably go up by 10% now ..)))) – ERJAN Sep 28 '17 at 12:17
  • 2
    git config --global alias.llog "log --all --graph --decorate --oneline" is the cmd u need to punch in cmd line – ERJAN Sep 28 '17 at 12:18