Attributing Pair/Mob Commits on GitHub

At Unruly, we endeavor to create all of our software using Pair-Programming (two developers working together ) or Mob-Programming (three or more developers working together).

We tended to struggle with how to attribute commits to multiple authors — having previously experimented with and decided against tools like git-pair(https://github.com/chrisk/git-pair).

Up until recently, we had used git’s author field to identify which people had worked on a particular commit.

$ git log --pretty=format:"%an" | head -n5
Stephen & Wilson
Stephen & Wilson
Narayan & Sarah & Stephen
Sarah & Stephen
Sarah & Stephen

Not particularly nice, and it makes using GitHub harder for browsing commits and code history.

Attributing commits to multiple authors

At the end of January this year, our wishes were finally granted — GitHub launched support for the Co-Authored-By trailer in commit messages (https://blog.github.com/2018-01-29-commit-together-with-co-authors/)

Using the Co-Authored-By trailer in our commits

Now we use this to match our commits against our own personal GitHub accounts, making attribution at a glance much easier.

We use this most of the time in one of our teams, and are evangelizing its adoption throughout the rest of the Product Development team at Unruly.

P.S. It also has the nice side-effect of “heating up” the activity graphs on our personal GitHub accounts. :)