← 返回命令列表

Linux command

git-reauthor 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Change the email address

git reauthor -o [old@email.com] -e [new@email.com]

Change both name and email

git reauthor -o [old@email.com] -n "[New Name]" -e [new@email.com]

Use values from `git config user.name` / `user.email`

git reauthor --use-config -o [old@email.com]

Rewrite all identities

git reauthor --all

Rewrite only the committer

git reauthor -o [old@email.com] -e [new@email.com] -t committer

说明

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.

参数

-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.

FAQ

What is the git-reauthor command used for?

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.

How do I run a basic git-reauthor example?

Run `git reauthor -o [old@email.com] -e [new@email.com]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -o, --old-email _EMAIL_ do in git-reauthor?

Email address to match on existing commits.