I am interested in knowing which one of the two users made the file changes when github lists both. The git record contains only UserA however.
Another one of possible reasons behind this happening is by using $GIT_AUTHOR_NAME
and $GIT_AUTHOR_EMAIL
env variables.
When these variables are set, they override the author part of every onward commit no matter what user.name
and user.email
config values are set locally. In this case, when you hit git cat-file -p HEAD
, author shows value of $GIT_AUTHOR_NAME
and committer shows value of local user.name
configuration.
So you'll need to remove lines that export these variables in .bashrc
or .zshrc
, or if you want to preserve those lines but just don't want this thing happen, insert unset GIT_AUTHOR_NAME && unset GIT_AUTHOR_EMAIL
before running git commit.