When I run git commit
, my favourite editor starts and presents me with something like this:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Your branch is up-to-date with 'origin/master'.
#
# Changes to be committed:
# …
I work on many different projects in different context, and as such have various Git identities. More than once I have to change an existing commit (or worse, a chain of existing commits) because I forgot to run git config user.email
.
Is it possible to show the current identity in the comments of the commit message, so that I see it when I write my commit message? That would help me to discover mistakes earlier.
Something along the lines of this would be fine:
# Author:
# jornane <[email protected]>