git-coauthor
Add co-authors to Git commit messages
TLDR
Insert an additional author to the last Git commit
SYNOPSIS
git coauthor [subcommand] [args]
PARAMETERS
add "Name <email>"
Add a new co-author to the list.
list
Show numbered list of all stored co-authors.
use [index1 [index2 ...]]
Select co-authors by index for next commit trailers.
remove index
Delete co-author at specified index.
edit [index]
Edit co-author entry with $EDITOR (default first if no index).
clear
Clear currently selected co-authors.
-h, --help
Display usage help.
-v, --version
Print tool version.
DESCRIPTION
git-coauthor is a lightweight command-line tool that simplifies adding and managing multiple co-authors to Git commits using the standardized Co-authored-by trailer format. Introduced to support Git's trailer feature (available since Git 2.10), it addresses the need for easy collaboration credits in pair programming, mentorship fixes, or team contributions without manual trailer editing each time.
The tool maintains a persistent, plain-text list of co-authors (name and email) in a user config file like ~/.git-coauthors. Key features include adding new entries, listing them with convenient indices, selecting specific ones for the next commit, editing or removing entries, and clearing selections. Selected co-authors are automatically injected as trailers into the commit message editor or via aliases/hooks.
Workflow example: git coauthor add "Jane Doe <jane@example.com>", git coauthor list, git coauthor use 1, then git commit. This ensures proper attribution while keeping commit messages clean. Portable across machines by syncing the co-authors file. Widely used in open-source and professional teams for reproducible multi-author workflows.
CAVEATS
Third-party tool, not in core Git; requires separate installation.
Co-author email must match contributor's Git config for accurate tracking.
Automatic trailer insertion needs git alias (e.g., commit-coauthor) or prepare-commit-msg hook setup.
May conflict if multiple coauthor tools installed.
STORAGE FILE
Defaults to $HOME/.git-coauthors or ${XDG_CONFIG_HOME}/git/coauthors.
Override with GIT_COAUTHORS_FILE env var.
INSTALLATION
brew install git-coauthor (macOS), npm i -g git-coauthor, or download script and ln -s git-coauthor ~/.local/bin/git-coauthor.
INTEGRATION TIP
Alias: git config --global alias.coauthor '!git coauthor use'.
Or add prepare-commit-msg hook for auto-trailers.
HISTORY
Emerged circa 2017-2018 alongside Git 2.13+ trailer improvements. Popular open-source implementations (e.g., on GitHub by developers like atomantic, nunomaduro) gained traction with 1k+ stars. Evolved from simple scripts to feature-rich tools supporting search, fuzzy matching, and IDE integrations.
SEE ALSO
git(1), git-commit(1), git-config(1)


