LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-reauthor

Rewrite commit authorship history

TLDR

Change the email address of matching commits
$ git reauthor -o [old@email.com] -e [new@email.com]
copy
Change both name and email
$ git reauthor -o [old@email.com] -n "[New Name]" -e [new@email.com]
copy
Use values from `git config user.name` / `user.email`
$ git reauthor --use-config -o [old@email.com]
copy
Rewrite all identities (prompts interactively)
$ git reauthor --all
copy
Rewrite only the committer (not author)
$ git reauthor -o [old@email.com] -e [new@email.com] -t committer
copy

SYNOPSIS

git reauthor [options]

DESCRIPTION

git reauthor rewrites commit history to correct author (and/or committer) information. It updates names and email addresses across all local branches and tags for every commit whose identity matches the supplied old email.The command is useful for fixing incorrect attribution, consolidating identities after email changes, or correcting authorship before publishing a repository. Because it rewrites history and changes every commit SHA in the rewritten range, it should only be used on branches that have not been shared.

PARAMETERS

-o, --old-email EMAIL

Email address to match on existing commits.
-e, --correct-email EMAIL
Replacement email address.
-n, --correct-name NAME
Replacement author/committer name.
-c, --use-config
Take the replacement name/email from the current git config values.
-a, --all
Rewrite all identities found in history (interactive).
-t, --type TYPE
Which identity to rewrite: author, committer, or both (default).
--help
Display help information.

CAVEATS

Part of git-extras package. Rewrites history. Don't use on shared branches. All commit hashes change.

HISTORY

git reauthor is part of git-extras, providing a convenient wrapper for the common task of fixing author information.

SEE ALSO

Copied to clipboard
Kai