Logo Questions Linux Laravel Mysql Ubuntu Git Menu

Cannot create simple Git alias in MinGW32 on windows 7

I am trying to create a very simple alias. I want alias the following command:

git log --oneline --graph --all -- decorate

I find this command a very useful way to view the log file. I want to alias this line as git l because its the main way I wish to view the log file. This is my attempt to create the alias:

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

This line executes without error, but then any attempt to call git l results in the following error message.

Expansion of alias 'l' failed; 'git' is not a git command

It was explained that working environment, windows 7, minGW32, and git version 1.8.3.msysgit.0 could have something to do with this issue, but I am not sure how to resolve this. Thank you to anyone who helps out.

like image 436
usumoio Avatar asked Mar 24 '23 05:03


1 Answers

It should be:

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

To call something other than a git command, you would prefix it with an exclamation point:

git config --global alias.foo "!foo --do-something"

In your case, it could've been:

git config --global alias.l "!git log --oneline --graph --all --decorate"
like image 134
John Szakmeister Avatar answered Apr 02 '23 09:04

John Szakmeister