Inspired by this reply about hex color-code in git log format, I tried to do the same. While directly using that in terminal, it is working fine:
$git log --format="%h%C(#ff69b4)%d%C(reset) %s"|head -1
dc814e3 (HEAD -> master, origin/master, origin/HEAD) Compilation help added
Problem arises if I add log --format="%h%C(#ff69b4)%d%C(reset) %s"
part in alias in .gitconfig
:
[alias]
ll =log --format="%h%C(#ff69b4)%d%C(reset) %s"
which gives error:
$git ll
fatal: ambiguous argument '%s': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
A search gives a solution to the same type of problem here: suggesting a trial of escaping the "
with \"
.
If I do this, e.g.
[alias]
ll =log --format=\"%h%C(#ff69b4)%d%C(reset) %s\"
I get error:
git ll
fatal: Bad alias.ll string: unclosed quote
I am using:
$echo $TERM; echo $SHELL; git --version
xterm-256color
/bin/bash
git version 2.4.3
what I am doing wrong here?