Published: Sep 1st, 2020
This is part of Joyful Rails, a list of recommendations to make developing your Rails app more productive and joyful.
In this article, we are talking about the “pairs” file.
The “pairs” file is helpful when you are doing a lot of pair-programming and want to be able to easily assign multiple authors to your git commits.
Having an accurate record of authors is useful when a developer needs to understand a section of code. This becomes especially important when the project is large, long-lived, and developed by a large team.
Pivotal’s git scripts make it easy to assign multiple authors to a commit.
Install the Pivotal git scripts:
gem install pivotal_git_scripts
.pairs file in the root directory with your team’s information:
pairs: gh: Grace Hopper; email@example.com al: Ada Lovelace; firstname.lastname@example.org mh: Margaret Hamilton; email@example.com
Then use the new Git subcommand to set the author(s) before making your commits. For example, if Grace and Margaret were working together, they would run the command with their initials like this:
git pair gh mh