Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including git-mob with all npm packages installed. Try it out:

git-mob lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

// require("git-mob/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

git-mob v0.4.0

CLI tool for including co-authors in commits.

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:

gif showing example usage of git-mob


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

By default git-mob will use the .gitmessage template to append co-authors.

Prepare commit msg setup

Do you want the co-authors appended to the message when using the command git commit -m "commit message"?

  1. git mob --installTemplate
  2. Add prepare-commit-msg to .git/hooks and see hook-examples

More details about above ^

--installTemplate This will create a file in your local .git folder where it will write the selected co-authors into.

prepare-commit-msg will need a script to read the co-authors template. See hook-examples folder for working scripts.

The command git mob-print will output to stdout the formatted co-authors which you can use in your own git hooks.

Revert back to default setup

  1. git mob --uninstallTemplate
  2. Remove prepare-commit-msg file

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 "Jane Doe"
$ git config --global ""

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": ""
    "bd": {
      "name": "Bob Doe",
      "email": ""

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

$ git mob ad
Jane Doe <>
Amy Doe <>

Commit like you normally would. You should see Co-authored-by: Amy Doe <> 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 <>
Amy Doe <>
Bob Doe <>

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

$ git solo
Jane Doe <>

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

$ git mob --list
jd Jane Doe
ad Amy Doe
bd Bob Doe

* 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


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free