Home > Enterprise >  How to get ref names with git log --pretty=format:"...."? %d shows refs, but all in same c
How to get ref names with git log --pretty=format:"...."? %d shows refs, but all in same c

Time:12-05

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:

enter image description here

Is there a way to get the refs printed in color such as in git log --oneline?

enter image description here

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).

  • Related