You may have a situation where a repository is mirrored to multiple remote URLs. One of the URLs is on Bitbucket and the other one is based on GitLab for example. Both are not the same email. Here is the command to make a commit with a specific author.
git commit -m <message>to create a new commit with the specified
- Use the
--authoroption to change the
<email>of the commit’s author.
git commit -m <message> --author="<name> <email>"
# Make some changes to files git add . git commit -m "Fix the network bug" --author="Tom Nguyen <firstname.lastname@example.org>" # Creates a commit by `Tom Nguyen`
This note will be recalled once I need to have a look at it again.