rewrite-coauthors
Add, replace, or remove coauthors in existing commit messages.
git-wrangler rewrite-coauthors <add|replace|remove> [options]Warning: This rewrites Git history. Coordinate with collaborators and use
git-wrangler push --forcewhen publishing the result.
Add coauthors
git-wrangler rewrite-coauthors add \
--coauthor "Jane Doe <jane@example.com>"
Repeat --coauthor to add more identities. A coauthor is added only when that email is not already present, ignoring letter casing. An existing display name is left unchanged.
Replace a coauthor
git-wrangler rewrite-coauthors replace \
--email old@example.com \
--coauthor "New Name <new@example.com>"
Only matching old emails are changed. If the new email is already present in the same commit, duplicate entries are combined and the supplied replacement identity is used.
Remove coauthors
# Remove selected emails
git-wrangler rewrite-coauthors remove \
--email former@example.com \
--email contractor@example.com
# Remove every coauthor entry
git-wrangler rewrite-coauthors remove --all
Use either repeatable --email values or --all, not both. --all also removes malformed coauthor entries that do not contain a valid name and email.
What stays unchanged
Other commit message trailers, such as sign-offs and reviews, keep their original text and order. Merge commits, Git-generated reverts, and fixup/squash/amend commits are skipped.
Shared options
| Option | Default | What it does |
|---|---|---|
--repo <path> |
Whole workspace | Rewrite exactly one repository. |
--rewrite-after YYYY-MM-DD |
— | Include commits on or after this current author date. |
--rewrite-before YYYY-MM-DD |
— | Include commits before this current author date. |
--no-fetch |
Off | Skip refreshing origin; remote information may be old. |
--yes, -y |
Off | Skip the rewrite confirmation. |
--guided |
Off | Choose options through prompts. |
Every supplied identity must use Name <email>. Duplicate input emails are rejected even when their letter casing differs.
Before you run it
git-filter-repo is required. Git Wrangler previews affected messages and records changed commits so rollback-rewrites can restore them later.
Related commands
- Use
commit --coauthorto add coauthors while creating new commits. - Use
rewrite-commitsto generate new messages while preserving coauthors.