A cross-platform command-line tool for social coding. Includes co-authors in commits when pair/mob programming.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github/ISSUE_TEMPLATE 📝 Add template for feature requests Jun 9, 2018
bin First step to solving issue #22 inline messages Nov 15, 2018
src First step to solving issue #22 inline messages Nov 15, 2018
test-helpers
.gitignore Add test .env file and exclude it from git ignore Apr 29, 2018
.npmignore Exclude .prettierignore from bundled package May 12, 2018
.prettierignore Prettier ignore package.json May 10, 2018
.prettierrc Add more prettier configuration Mar 31, 2018
.travis.yml 👷 Symlink package in CI build Mar 31, 2018
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Jun 9, 2018
CONTRIBUTING.md 📝 Document release step for pushing git commit and tag Jun 9, 2018
README.md Update --help and readme with --list flag command Sep 12, 2018
package-lock.json First step to solving issue #22 inline messages Nov 15, 2018
package.json First step to solving issue #22 inline messages Nov 15, 2018

README.md

Git Mob npm version build status

A command-line tool for social coding

Includes co-authors in commits when you collaborate on code. Use when pairing with a buddy or mobbing with your team.

Read our blog post to find out why git-mob exists: http://tech.findmypast.com/co-author-commits-with-git-mob

gif showing example usage of git-mob

Install

Warning: This package hasn't reached v1.0.0 yet. There may be many missing features, lots of bugs, and the API could change until we reach a stable version.

git-mob is a CLI tool, so you'll need to install the package globally.

npm i -g git-mob

Workflow / Usage

With git-mob, the primary author will always be the primary user of the computer. Set your author info in git if you haven't done so before.

$ git config --global user.name "Jane Doe"
$ git config --global user.email "jane@example.com"

To keep track of potential co-authors, git-mob uses a JSON file called ~/.git-coauthors. Here's a template of its structure.

{
  "coauthors": {
    "<initials>": {
      "name": "<name>",
      "email": "<email>"
    }
  }
}

Start by adding a few co-authors that you work with.

$ cat <<-EOF > ~/.git-coauthors
{
  "coauthors": {
    "ad": {
      "name": "Amy Doe",
      "email": "amy@findmypast.com"
    },
    "bd": {
      "name": "Bob Doe",
      "email": "bob@findmypast.com"
    }
  }
}
EOF

You're ready to create your mob. Tell git-mob you're pairing with Amy by using her initials.

$ git mob ad
Jane Doe <jane@example.com>
Amy Doe <amy@example.com>

Commit like you normally would. You should see Co-authored-by: Amy Doe <amy@example.com> appear at the end of the commit message.

Let's add Bob to the group to create a three-person mob.

$ git mob ad bd
Jane Doe <jane@example.com>
Amy Doe <amy@example.com>
Bob Doe <bob@example.com>

Once you're done mobbing, switch back to developing solo.*

$ git solo
Jane Doe <jane@example.com>

Check which co-authors you have available in your .git-coauthors file.

$ git mob --list
jd Jane Doe jane@example.com
ad Amy Doe amy@example.com
bd Bob Doe bob@example.com

* If you have git-duet installed, you'll need to uninstall it since it conflicts with the git-solo command.

Find out more with git mob --help