If you don't mind that a little bit more is printed, you can set the GIT_TRACE
variable to 1
and git will print (among other) some information about alias expansion (cf. the man page).
In my case (I have defined an alias st
for status
), this looks like this:
$ GIT_TRACE=1 git st
trace: exec: 'git-st'
trace: run_command: 'git-st'
trace: alias expansion: st => 'status'
trace: built-in: git 'status'
Of course, you can for example put export GIT_TRACE=1
in your .bashrc
to have this always enabled.
If you really want to show only the alias expansion, you could probably define a shell alias for git
that runs git and filters out all lines from the output that start with trace:
but do not contain alias expansion:
.