Structure and Interpretation of Computer Programmers

I make it easier and faster for you to write high-quality software.

Wednesday, January 29, 2020

Pairing in Github

In the world of free software, it’s good to appropriately credit contributors to your community for the work they do.

git makes this hard when you pair program. I was at a hackathon recently, and while I didn’t make a single commit, I sat next to a lot of other people who made plenty of commits based on conversations we had, and suggested a lot of things to try to debug problems, and invented solutions that made it into those commits. No highly-nutritious green squares in github for me, no external evidence that I had contributed two days of my time to these free software projects.

When I pair, if I’m committing, I make sure that I acknowledge the contribution my pair makes as equal to my own. In the github UI, it looks like this. You can see that both of us contributed to the commit.

How do I do this? I commit like this:

git commit -m 'We fixed this thing' --author 'Jennifer H. Pair <>'

Now both accounts are linked in the UI, because I’m the committer and my pair is the author. This isn’t perfect, because github doesn’t acknowledge the author in their contribution graph, only the committer. If there’s a more egalitarian way to acknowledge my pair I’d want to follow that, but for the moment I’m happy to at least demonstrate that they authored the change I typed into a text editor.

posted by Graham at 16:42  


  1. If you’re doing it with some regularity, there’s a git extension-ish tool called git-duet which does a great job of making a pairing modal setup for your shell

    Comment by Orta — 2020-01-29 @ 16:46

  2. I was about to link to Git Duet too but Orta beat me to it. It’s fantastic for pairing.

    Comment by Ben — 2020-01-29 @ 19:44

  3. I use a Co-Authored-By trailer to the commit message and this correctly attributes myself and my pairing partner(s) as authors on GitHub.

    Comment by Neil — 2020-01-29 @ 23:12

  4. Why not just use coauthors?

    It’s expected to be adopted by git core as well.

    Comment by Tyler — 2020-01-30 @ 01:06

  5. You could also use Co-authored-by

    Comment by vanguard — 2020-01-30 @ 07:14

  6. I prefer tools like git-mob which use the Co-authored-by trailer in commit notes. These trailers are recognised by GitHub.

    Comment by James Mead — 2020-01-30 @ 09:39

  7. git-pair is a simpler script for automatically adding Co-Authored-By lines:

    Comment by Charles — 2020-01-30 @ 10:44

  8. Use the word “just” in a software context, I double my estimates.

    Comment by Graham — 2020-01-30 @ 12:23

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress