I'm trying to get a customized git log listing using --pretty=format:"....", but can't seem to find out how get the ref names colored as in git log --oneline
. This is my log command so far:
git log --pretty=format:"%C(yellow)%h%Creset %d %ci (%cr)%n ==> %s%n"
It displays all I want, except for the coloring of the refs:
Is there a way to get the refs printed in color such as in git log --oneline
?
CodePudding user response:
Use of %C
directives disables automatic colorization unless you re-enable it with %C(auto)
. You can just replace the %Creset
part with %C(auto)
(per testing).