HiveBrain v1.2.0
Get Started
← Back to all entries
snippetjavascriptTip

How to add multiple authors to a commit

Submitted by: @import:30-seconds-of-code··
0
Viewed 0 times
howgitcommitmultipleauthorsadd

Problem

You can add multiple authors to a git commit, by adding one or more Co-authored-by trailers to the commit's message:
  • To correctly attribute a commit to a co-author, you must use the email associated with their GitHub account.
  • If a person's email is private, you can use their GitHub-provided no-reply email.
  • Leave one or preferably two empty lines before any Co-authored-by trailers.

Solution

$ git commit -m "Refactor usability tests.
>
>
Co-authored-by: name <name@example.com>
Co-authored-by: another-name <another-name@example.com>"


  • If a person's email is private, you can use their GitHub-provided no-reply email.
  • Leave one or preferably two empty lines before any Co-authored-by trailers.

Code Snippets

$ git commit -m "Refactor usability tests.
>
>
Co-authored-by: name <name@example.com>
Co-authored-by: another-name <another-name@example.com>"

Context

From 30-seconds-of-code: github-co-authors

Revisions (0)

No revisions yet.