Skip to content
Configure git to commit as more than one author.
Ruby Cucumber
Pull request Compare This branch is 11 commits ahead of ingemar:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



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


Install the gem:

gem install mynewsdesk-git-pair

And here's how to use it!

$ 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
        --pattern PATTERN            Set email pattern. Example: "dev+%name+%name@%domain"
                                       %name   - First name
                                       %last   - Last name
                                       %abbr   - Abbreviation
                                       %domain - Use domain from global config
        --remove-pattern             Reset the current email pattern to default.

Switching authors:
  git pair aa [bb]                   Where AA and BB are any initials or first/last name
                                     of an author. You can specify one or more authors.

Current config:
     Author list: Adam McCrea
                  Jon Distad

  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 is generated using the default email address from the global configuration along with the developer abbreviations.

About this version

This was forked from, which its turn was forked from Many thanks to Chris Kampmeier for the original version. Jon Distad and Ehren Murdick's version added the --reset option and did a great job refactoring the code.

We updated the gem to depend on Bundler rather than Jeweler and added the option to configure how the pair's email address is generated since the hardcoded one didn't adopt to the one we got by using Hitch.


Copyright (c) 2009 Chris Kampmeier. See LICENSE for details.

Something went wrong with that request. Please try again.