create git alias for `git log --all --decorate --graph --oneline`
Asked Answered
O

3

7

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!

Oscillograph answered 10/12, 2016 at 0:17 Comment(2)
You can't alias just a set of parameters like that, you have to alias the command. Try git config --global alias.adgo "log --all ...".Gunboat
For what it's worth this alias is often spelled lola: blog.kfish.org/2010/04/git-lola.html (--oneline, which was added to Git after this April 2010 blog entry, is short for --pretty=oneline --abbrev-commit).Reverend
C
14

You need to define it as

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

then use it as

git adgo
Corina answered 10/12, 2016 at 0:24 Comment(0)
S
-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!

Sundial answered 18/4, 2022 at 15:30 Comment(1)
Welcome to StackOverflow! Thank you for your contribution, but in this case, I don't think you'd adding new information to the accepted answer, you're just explaining the same thing in more words. Adding a new answer to an old question is encouraged if you can provide a better answer or new information, but generally not just for rephrasing the same information.Complected
T
-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

Tasha answered 8/8 at 9:26 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Medin

© 2022 - 2024 — McMap. All rights reserved.