Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Configure git to commit as more than one author.
Pull request Compare This branch is 25 commits ahead, 2 commits behind neo:master.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Retina-ready Shields example

A git porcelain for changing and so you can commit as more than one author.


Install the gem:

gem install edsinclair-git-pair


$ git pair

General Syntax:
  git pair [reset | authors | options]

    -a, --add AUTHOR                 Add an author. Format: "Author Name <>"
    -r, --remove NAME                Remove an author. Use the full name.
    -d, --reset                      Reset current author to default (global) config
    -s, --show 'aa [bb]'             Show the string to be used for the commit author field
        --install-hook               Install a post-commit hook for the current repo. See git-pair/hooks/post-commit for more information.
        --email EMAIL                Add a default email address to be used for pairs

Switching authors:
  git pair aa [bb]                   Where AA and BB are any abbreviation of an
                                     author's name. You can specify one or more authors.

Current config:
     Author list: Adam McCrea <>
                  Jon Distad <>

     Pair email:

  Current author: Jon Distad + Adam McCrea
   Current email:

How does it work?

The list of authors is maintained in the global git configuration file. The current author is set in the git configuration local to the project. The email address for a pair will be generated using the first author's email domain part and the address local parts separated by a '+' will precede the '@'.

You can specify a 'pair' email address to be used in which case the local part will be followed by each author's initials separated by a '+' will be used to form the local part of the pair email address. Alternatively if you leave off the local part and specify the pair email address as '@domain.tld' the local part for the pair email will be composed of the local part for each author's email address.

Examples with the git pair email set:

If the git pair email is: Then pair email address will be If the git pair email is: Then pair email address will be

Examples without the git pair email set:

First author is Adam McCrea. Then pair email address will be First author is Jon Disatd. Then pair email address will be

About this version

This was forked from which in turn was forked from Many thanks to Chris Kampmeier for the original version and Adam McCrea, John Distad and Ehren Murdick for the features they added to the edgecase release. This version adds a --show, --email and --install-hook options and converts the gem to use Bundler for dependency management.


Copyright (c) 2009 Chris Kampmeier. Copyright (c) 2013 Eirik Dentz Sinclair. See LICENSE for details.

Something went wrong with that request. Please try again.