Pair programming or got a critical assist? Credit the collaborator in the commit:
git commit -m "feat: implement OAuth
Co-authored-by: Alex Doe <alex@example.com>
Co-authored-by: Sam Smith <sam@example.com>"
The footer must be the literal text Co-authored-by:, blank line above, and a valid email. GitHub matches these to user accounts and credits them on the commit page + contribution graph.
For ongoing pairs, add a Git alias:
git config --global alias.pair "!f() { git commit -m \"\$1\n\nCo-authored-by: \$2\"; }; f"
Then: git pair "feat: x" "Alex <alex@example.com>".
Co-authorship works on regular commits and amended ones. It does NOT replace the primary author — user.name / user.email is still the committer; co-authors get visibility credit.