Skip to content
Git plugin for pair programming
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Oct 27, 2018
git-pair Remove hyphens from function names to make them more portable across … Dec 14, 2018
prepare-commit-msg Fix issue on Dash where setting IFS to $'\n' doesn't correctly expand… Jan 15, 2019

Git for Pair Programming

Git commit messages can only have one author. However, there is a convention that multiple authors can be recorded by lines beginning with Co-authored-by: at the end of a commit message. This convention is now supported by GitHub so all the co-authors can share the internet points.

This POSIX shell git plugin makes it easy to manage pair programming sessions and automatically add the appropriate Co-authored-by trailers to your commit messages.


  • Put the git-pair script somewhere in your $PATH.
  • Put the prepare-commit-msg script in .git/hooks/ inside each of your repos.

That last step is a bit tedious. I suggest you create a shell alias like so:

alias git-pair-init="cp /somewhere/prepare-commit-msg .git/hooks"


$ git pair add rh "Robin Hood <>"
$ git pair add mm "Maid Marion <>"
$ git pair add ft "Friar Tuck <>"
$ git pair add lj "Little John <>"
$ git pair list
rh Robin Hood <>
mm Maid Marion <>
ft Friar Tuck <>
lj Little John <>

$ git pair show
No pairs currently set.
$ git pair set mm ft
$ git pair show
Maid Marion <>
Friar Tuck <>

$ git commit -m 'Something informative'
Committing with co-authors:
 + Maid Marion <>
 + Friar Tuck <>
[master d898f8d] Something informative
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo
$ git log -n1
commit d898f8d3d83759843d19bf71b78ce6089929ccce (HEAD -> master)
Author: Your Usual Git Username <>
Date:   Sat Oct 27 14:17:30 2018 +0100

    Something informative

    Co-authored-by: Maid Marion <>
    Co-authored-by: Friar Tuck <>


The list of possible authors is stored in your global .gitconfig. The list of currently active authors is stored in the local .git/config of your current repo. This way you can have different authors active in different repos at the same time, but you can share their contact details across all repos.

You can’t perform that action at this time.