Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Use GitHub’s "Co-authored-by" when there are multiple authors

There are occasions when there are multiple author for a patch. For example when there is a patch that is abandoned by its original author for any reason, and it can no longer be merged, or it's unfinished, someone might pick it up and finish it. (After asking the original author if he is still working on it or not).

In these occasions, we should also attribute the original author by adding one or more Co-authored-by trailers to the commit’s message. See the GitHub documentation for

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

 "Creating a commit with multiple authors".

As this is a GitHub feature, Co-author will show up on GitHub's statistics.

In short, these are the steps to add Co-authors that will be tracked by GitHub:

  1. Collect the name and email address for each co-author.

  2. Commit the change, but after your commit description, instead of a closing quotation, add two empty lines. (Do not close the commit message with a quotation mark)On the next line of the commit message, type close the commit message with a quotation mark)

  3. On the next line of the commit message, type Co-authored-by: name <name@example.com>. After the co-author information, add a closing quotation mark.

Here is the example from the GitHub page, using 2 Co-authors:

Code Block
languagebash
$ git commit -m "Refactor usability tests.
>
>
Co-authored-by: name

...

 <name@example.com>
Co-authored-by: another-name <another-name@example.com>"

Final Checks on Pull Request

...