git mob
You can attribute a git commit to more than one author by adding one or more Co-authored-by
trailers to the commit's message. Co-authored commits are visible on GitHub. For more information, see here.
This CLI app will help you add them automatically and also help you store and manage co-authors for pair/mob programming sessions.
Features
- Cross-platform
- Co-authors management via CLI
- Multi-select menu to choose co-author(s) for mobbing
- Automatic appending of
Co-authored-by
trailers to commit - No need of any git aliases
Installation
Prerequisites
With Binary Package:
- Download and extract the appropriate binary depending on your OS from the latest GitHub release
- Ensure the binary is in your
PATH
variable
With Cargo:
- Install Rust and Cargo
- If you are using Windows, you will also need to install certain C++ build tools
Configuration
-
Store your team members' details with keys (usually initials)
-
Set a global
githooks
directory -
Copy
prepare-commit-msg
into the directory. Ensure it is set as executable.This
githook
will be used to append theCo-authored-by
trailers to the commit's message.
Usage
-
To mob with some team member(s):
$ git mob --with ? Select active co-authors(s): > [ ] Leo Messi <leo.messi@example.com> [ ] Emi Martinez <emi.martinez@example.com> [ ] Sergio Aguero <sergio.aguero@example.com> [↑↓ to move, space to select one, → to all, ← to none, type to filter ]
Alternatively, if you remember the co-author keys, you may bypass the multi-select menu by running:
This will start a global mob session. Any git commit made afterwards will have
Co-authored-by
trailers added to the commit message as shown below:This is an example commit message Co-authored-by: Leo Messi <leo.messi@example.com> Co-authored-by: Emi Martinez <emi.martinez@example.com>
-
To clear the mob session:
-
To view the co-authors in the current mob session:
-
To print help information:
Troubleshooting
- Try installing the latest version of git