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 <jenny.pair@example.com>'

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.

About Graham

I make it faster and easier for you to create high-quality code.
This entry was posted in process, tool-support. Bookmark the permalink.

8 Responses to Pairing in Github

  1. Orta says:

    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

    https://artsy.github.io/blog/2018/10/19/pair-programming/#Remote

  2. Ben says:

    I was about to link to Git Duet too but Orta beat me to it. It’s fantastic for pairing. https://github.com/git-duet/git-duet

  3. Neil says:

    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.

  4. Tyler says:

    Why not just use coauthors? https://github.blog/2018-01-29-commit-together-with-co-authors/

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

  5. James Mead says:

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

  6. Charles says:

    git-pair is a simpler script for automatically adding Co-Authored-By lines: https://github.com/cac04/git-pair

  7. Graham says:

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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.