Create or update a commit by a specified author

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.

  • Use git commit -m <message> to create a new commit with the specified <message>.
  • Use the --author option to change the <name> and <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 <tom.nguyen@itersdesktop.com>"
# Creates a commit by `Tom Nguyen`

This note will be recalled once I need to have a look at it again.

Nguyen Vu Ngoc Tung

I love making new professional acquaintances. Don't hesitate to contact me via nguyenvungoctung@gmail.com if you want to talk about information technology, education, and research on complex networks analysis (i.e., metabolic networks analysis), data analysis, and applications of graph theory. Specialties: researching and proposing innovative business approaches to organizations, evaluating and consulting about usability engineering, training and employee development, web technologies, software architecture.

https://www.itersdesktop.com/author/nvntung/

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.