How to attribute a single commit to multiple developers? How to attribute a single commit to multiple developers? git git

How to attribute a single commit to multiple developers?


Commit titleCommit bodyCo-authored-by: name <additional-dev-1@example.com>Co-authored-by: name <additional-dev-2@example.com>

One problem with this approach is that you can't create a signed key for this group of devs, so you could essentially add anybody to this list even if they didn't work on a feature and GitHub would treat it as if they did. However, this shouldn't be an issue in most cases.

e.g. Co-authored-by: Linus Torvalds <torvalds@linux-foundation.org>

With normal authors or signing groups (the old method) you would see it's not signed and know that you can't trust the commit. However, there is no signing process on co-authors.


Mostly outdated answer:

One solution would be to set a name for the pair:

git config user.name "Chris Wilson and John Smith"

Here is a related bug report with other temporary solutions:

Bug git-core: Git should support multiple authors for a commit


A git convention is to use Co-Authored-By at the end of the commit message (git kernel: Commit Message Conventions, referring to Openstack Commit Messages). This is also one of the solutions on the git-core bug linked in Gerry's answer

Co-authored-by: Some One <some.one@example.foo>

In that comment on May 5, 2010, Josh Triplett also suggests implementing corresponding support in git.

As Llopis pointed out in a comment, GitHub announced support for this on their blog on Jan 29, 2018: Commit together with co-authors (details).


For Bazaar:

bzr commit --author Joe --author Alice --author Bob

Those names will be shown in the log separately from committer name.