Git pair programming tools
Allows you to commit with two users by making one the committer and the other the author. Also lets you switch users easily.
Credit to @roylines for the original idea in his gits repo.
npm install git-pair -g
You can also install git-pair locally:
npm install git-pair
This will install the git alias to the local git config, to use gitp you need to run:
Configure the users for your pair with
git users, then use
gitp instead of
git users firstname.lastname@example.org email@example.com gitp commit -m "Did the code"
This alias allows you to get or set git users. You can find out which users are currently configured using:
You can set users using their email addresses:
git users firstname.lastname@example.org email@example.com
This looks up git usernames from GitHub, alternatively you can specify usernames explicitly:
git users jane:firstname.lastname@example.org bob:email@example.com
The users are stored as values in
git config. The first user entered is always the normal git user.
gitp is a wrapper executable for
git which injects git committer and author environment variables to the command to allow two people to contribute to a commit. It alternates the committer and author in each commit.
Simply use it as you would use git e.g.
gitp commit -m "Fixed the thing"
You can also alias this over
git to use this in place of it. I prefer this because it prevents people from accidentally committing with a single user. Simply add
alias git='gitp' to
~/.bash_profile on Mac).