Setting up a complex git alias

I would like to set up a git alias that after git log started

 git log --pretty=format:"%C(yellow)%h %C(red)%an, %C(green)%ar %""s" --since=2.weeks –n20 

I tried to run

 git config --global alias.log 'log --pretty=format:"%C(yellow)%h %C(red)%an, %C(green)%ar %""s" --since=2.weeks –n20' 

And confirmed that it is written in .gitconfig as

  28 [alias] … 34 log = log --pretty=format:\"%C(yellow)%h %C(red)%an, %C(green)%ar %\"\"s\" --since=2.weeks –n20 

However, it does not format git output as expected.

What am I missing, please?

+7
source share
1 answer

From the git documentation:

To avoid confusion and problems using the script, aliases that hide existing git commands are ignored.

You will need to rename your nickname.

+11
source

All Articles