Git commits with coauthor / multiple authors

Git does not have a integral mechanism to have multiple authors per Git commit. A Git coauthor notation convention has become accepted by some major services.

  • Github: supported
  • GitLab: supported
  • Bitbucket: not supported

Syntax

The Git coauthor convention is placing plaintext in the commit message body. To track commits on GitHub or other services, the email address cited must match a registered email with that service. The email can be a working public email or the “fake” noreply email provided by the Git service. Multiple coauthors each use the same syntax on the same Git commit.

added foo function to bar.py

Co-authored-by: David <snake@users.noreply.github.com>

Coauthor tracking

On GitHub, a coauthor commit looks like:

GitHub coauthor detail

Currently, the coauthored commit doesn’t count on the user’s GitHub contribution calendar. I suppose the coauthor commits don’t count toward the contribution calendar to avoid stuffing / inflating contribution count of users.

GitHub contribution calendar

The coauthor commits do show up in GitHub search under “Commits”.

Caveats

As with regular Git commits, there is no authentication to avoid someone masquerading as someone else with Git coauthor commits. Git coauthor commits cannot be GPG signed for each coauthor, only the primary Git committer can GPG sign as usual.