LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-coauthor

Add co-author attribution to the last commit

TLDR

Add a coauthor to the last commit
$ git coauthor "[Name]" "[email@example.com]"
copy
Add a second coauthor (run again against the same commit)
$ git coauthor "[Name2]" "[email2@example.com]"
copy

SYNOPSIS

git coauthor name email

DESCRIPTION

git coauthor is a git-extras command that amends the last commit message to add a Co-authored-by: trailer, the format GitHub and GitLab recognize to credit multiple contributors on one commit.It takes exactly one name and one email per invocation. To credit several people, run the command once per coauthor: since it appends to any Co-authored-by: trailers already present rather than replacing them, running it repeatedly against the same commit stacks up multiple coauthors.This supports pair programming, mob programming, and collaborative workflows where attribution should reflect everyone who contributed, not just whoever typed git commit.

PARAMETERS

NAME

Coauthor's name. Required.
EMAIL
Coauthor's email. Required.

INSTALL

sudo apt install git
copy
sudo dnf install git
copy
sudo pacman -S git
copy
sudo apk add git
copy
sudo zypper install git
copy
brew install git
copy
nix profile install nixpkgs#git
copy

CAVEATS

Part of the git-extras package. Amends the last commit, which rewrites its hash, so avoid using it on commits already pushed to a shared branch. Both name and email are required; the command has no flags and does not validate its arguments. Coauthor emails must match the contributor's platform account for GitHub/GitLab to link the attribution to a profile.

HISTORY

git coauthor is part of git-extras, the community-maintained collection of Git utility scripts, added to support GitHub's co-author trailer convention for attributing collaborative work.

SEE ALSO

RESOURCES

Copied to clipboard
Kai