CLI Tool for co-authoring commits.
git clone [email protected]:dplain90/gpair.git
- Add the path for
/gpair/bin
to your$PATH
variable in yourbash_profile
OR.zshrc
source ~/.bash_profile
ORsource ~/.zshrc
gpair
Optional Steps
-
To add an alias to gpair for git:
git config --global alias.pair '!gpair'
Then you can run gpair through the command:
git pair
-
In the root directory of your repository add a file called
.pairs
. This file stores pair data for authors participating in that repo. Add all the co-authors for your repo to this file.EXAMPLE:
The format for each author is:
[<Initials>]: <Name>; <Github Email>
pairs:
[dp]: Danny Plain; [email protected]
[js]: Jane Smith; [email protected]
- Add
.current-pair
to your.gitignore
.
At the beginning of a pairing session, run gpair set <pair_initials>
When you are ready to commit just run gpair commit "commit message" [git options]
. Gpair will append the co-authoring lines to your commit message, then create the commit.
NOTE: You can pass any available git commit
options after the commit message. EX: --no-verify
When you are done pairing, run gpair clear
to remove your current pair.
Gpair supports several commands, each accessible through the gpair
command. For help on individual commands, add --help
or -h
following the command name. The commands are:
Sets a current pair
Creates a commit, appending your pair's information as the co-author.
Clears your current pair.
Lists all available pairs in the repository
Displays your current pair's information
Adds a new author to the repository's pair list
Removes an author from the repository's pair list