/git-pair

Configure git to commit as more than one author.

Primary LanguageRubyMIT LicenseMIT

git-pair

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

Usage

The gem currently is not available on rubygems.

First you will need to install a helper gem that makes installing directly from github possible:

gem install specific_install

Then go and install the gem:

gem specific_install https://github.com/12finger/git-pair

And here's how to use it!

$ git pair

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

Options:
    -a, --add AUTHOR                 Add an author. Format: "Author Name <author@example.com>"
    -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: devs+jd+am@mynewsdesk.com

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 git-pair domain from the global configuration along with the developer abbreviations (as per the setup PATTERN).

About this version

This was forked from http://github.com/mynewsdesk/git-pair, which in turn was forked from http://github.com/chrisk/git-pair. Many thanks to Chris Kampmeier for the original version and to mynewsdesk for the improved version.

I updated the gem to make use of a new git-config setting:

[git-pair] besides the traditional [user] setting:

[user]
  name = Patrick Kozma
  email = patrick@12finger.com

[git-pair]
  domain = mynewsdesk.com

so there you can put your companies domain which then will be used for building the pairing email address.

On git pair --reset / git pair -d or in case there is no pairing, then the actual

License

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