Search code examples
gitrepository

create git alias for `git log --all --decorate --graph --oneline`


I use the command git log --all --decorate --graph --oneline very often and I want to create an git alias for --all --decorate --graph --oneline.

I tried with git config --global alias.adgo "--all --decorate --graph --oneline", but when I typed git log adgo afterward, an error message was displayed, saying "fatal, ambiguous argument adgo".

Could someone tell how to get this git alias working? I have been struggling for a while now. Appreciate any help!


Solution

  • You need to define it as

    git config --global alias.adgo  "log --all --decorate --graph --oneline"
    

    then use it as

    git adgo