Skip to content

Instantly share code, notes, and snippets.

@KenanBek
Last active November 14, 2022 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KenanBek/c4b99f74b62354861281ae1ebe32d1e5 to your computer and use it in GitHub Desktop.
Save KenanBek/c4b99f74b62354861281ae1ebe32d1e5 to your computer and use it in GitHub Desktop.

Useful commands to amend author and committer information.

First, basics. Setting user name and email:

# local, for project level
git config user.name "Kanan Rahimov"
git config user.email mail@kenanbek.me

# global
git config --global user.name "Kanan Rahimov"
git config --global user.email mail@kenanbek.me

Amend author information:

git commit --amend --author="Kanan Rahimov <mail@kenanbek.me>" --no-edit

Reset author and committer information for the most recent commit:

git commit --amend --no-edit --reset-author

Reset author and committer information for entire history:

git rebase -r --root --exec "git commit --amend --no-edit --reset-author"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment