LinuxCommandLibrary

git-reauthor

Correct commit authorship information

TLDR

Change an author's email and name across the whole Git repository

$ git reauthor [[-o|--old-email]] [old@example.com] [[-e|--correct-email]] [new@example.com] [[-n|--correct-name]] "[name]"
copy

Change the email and name to the ones defined in the Git config
$ git reauthor [[-o|--old-email]] [old@example.com] [[-c|--use-config]]
copy

Change the email and name of all commits, regardless of their original author
$ git reauthor [[-a|--all]] [[-e|--correct-email]] [name@example.com] [[-n|--correct-name]] [name]
copy

SYNOPSIS

git reauthor [-a --author=STRING | -c --committer=STRING] [since-commit] [--] [pathspec…]

PARAMETERS

-a, --author STRING
    Set author name and email (format: "Name <email@example.com>") for matching commits

-c, --committer STRING
    Set committer name and email (format: "Name <email@example.com>") for matching commits

DESCRIPTION

git-reauthor is a utility command, typically from the git-extras package, designed to rewrite the author and/or committer information across a range of commits in a Git repository.

It leverages git filter-branch under the hood to perform history rewriting, allowing users to uniformly update authorship details—such as name and email—for commits matching a specified range or pathspec. This is particularly useful for correcting mistaken author info after repository migrations, team changes, or when enforcing consistent authorship policies.

For example, if commits were authored under an old email after a domain change, git-reauthor can bulk-update them to the new identity without interactive rebasing. It processes the specified revision range (defaulting to all commits if none given) and applies the new author/committer strings to matching commits.

Warning: Like all history-rewriting tools, it alters commit hashes irreversibly, requiring git push --force to shared remotes. Always back up your repository first. It's not a core Git command but enhances workflow for maintenance tasks.

CAVEATS

Alters commit SHAs; use git push --force-with-lease carefully on shared repos.
Requires clean working tree. Not suitable for public history without coordination.
Deprecated in favor of faster git filter-repo.

EXAMPLE

Update authors from commit X:
git reauthor -a "New Author <new@ex.com>" X..

Update both author and committer:
git reauthor -a "Author <a@ex.com>" -c "Committer <c@ex.com>" master

HISTORY

Introduced in git-extras (2013) by Mark Otto and contributors as a convenience wrapper around git filter-branch.
Popularity grew for repo cleanup; now less used post-git 2.22 with filter-repo recommendation.

SEE ALSO

git filter-branch(1), git filter-repo(1), git rebase(1), git commit(1)

Copied to clipboard