Thor
Thor

Reputation: 393

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!

Upvotes: 9

Views: 7469

Answers (3)

Victor Elgersma
Victor Elgersma

Reputation: 1

If you use oh my zsh, you can use 'glol' Check out the cheatsheet here: https://kapeli.com/cheat_sheets/Oh-My-Zsh_Git.docset/Contents/Resources/Documents/index

Upvotes: -1

Gwyn Evans
Gwyn Evans

Reputation: 1521

You need to define it as

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

then use it as

git adgo

Upvotes: 16

NamishRI
NamishRI

Reputation: 1

You are trying to set like this:

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

Have to run this:

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

Now try running this command

git adgo

The one who have taught you git didn't told you that this is the right way to set an alias:

git config --global alias.<alias> "<cmd> <options>"

HOPE THIS ANSWER HELPED!

Upvotes: -1

Related Questions