Where is the format of git log --oneline --decorate defined?
Using git Iog --format=format:'my format', I cannot reproduce the colours of the branches, tags and HEAD as shown by git log --oneline --decorate.
git log --oneline --decorate
shows HEAD in light blue, the branch names in green and the punctuations (,,) in brown.
The closest I have come to getting what I want is:
git log --graph --abbrev-commit --decorate --date=short --format=format:'%C(bold blue)%h%C(reset) %C(bold green)%ad%C(reset)%d %C(white)%s%C(reset)' -20
with the only difference being that the branches/HEAD/tags are not coloured like with the previous command.
%d
you may want to use%D
for some use cases but%d
does match the--oneline --decorate
rendering. Also note that%Creset
does also work but%Cauto
does not work and one must use%C(auto)
for nice colors. Also, you may often wanttformat
instead offormat
. – Arbitrage