If someone else wrote the code you are committing, you can give them credit with the --author option:

git commit -m "msg" --author "John Smith <[email protected]>"

You can also provide a pattern, which Git will use to search for previous authors:

git commit -m "msg" --author "John"

In this case, the author information from the most recent commit with an author containing “John” will be used.

On GitHub, commits made in either of the above ways will show a large author’s thumbnail, with the committer’s smaller and in front:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d5e877b4-0eaa-4995-9812-c72aad9fffd5/Untitled.png