Issue
I used git-bash
on Windows 7
, and I found very convenient when doing a
git log
that local or remote branch(es) name(s) were mentionned near the sha-1 of each commit where it was accurate.
It was really useful at the time I had to do a rebase -i
, to select the good commit id to summarize my local branch before pushing it.
Going to Debian 9
now, I do not need to install git-bash
. However, a git log
no more mention me the accorded branches of my commit ids. Is this a special customisation of my git log
command that git-bash
does and that I can reproduce ?
Thanks
Solution
You might want to use the --decorate
option. From man git-log
:
--no-decorate, --decorate[=short|full|auto|no]
Print out the ref names of any commits that are shown. If short is specified, the ref name prefixes refs/heads/, refs/tags/ and refs/remotes/
will not be printed. If full is specified, the full ref name (including prefix) will be printed. If auto is specified, then if the output is
going to a terminal, the ref names are shown as if short were given, otherwise no ref names are shown. The default option is short.
I also must mention that on my version of Git (2.20.1), the branches are automatically displayed with git log
. Which version of Git do you use?
Answered By - padawin