Co-author commits
VS Code extension to add multiple co-authors to commits, managed all from the source control tab.
Great extension when pair programming or mobbing with your team. Requires Git Mob cli
The Git Mob project for VS code co-author commits
Read our blog post to find out learn more about Git Mob.
Install
Git Mob Cli is needed and supports:
- Global install
npm i -g git-mob
- Dev dependency
npm i -D git-mob
(See git-mob for more info)
Search for "git-mob" in Extensions and click install.
Ensure you have set your primary author in Git
$ git config --global user.name "Jane Doe"
$ git config --global user.email "[email protected]"
Features
- Manage & view all your co-authors in source control tab
- Search GitHub for co-authors, see setting options to learn more.
- Change primary author from co-author list
- Search suggested co-authors from the "More Authors" list (all contributors to the repository)
- Add new co-authors and manage them in
.git-coauthors
file - Add new co-authors from current repository into your
.git-coauthors
file - Git emojis search and select Gitmojis
- VS Code workspace support
- Select multiple co-authors (shift or ctrl) to be added to commit
- Auto reload when updating
.git-coauthors
file in VS Code - Configurable see setting options
prepare-commit-msg
hook support removed in v1.12.0
Add new co-authors
Option 1: CTRL+shift+p
or ⌘+⇧+p
and search for "Add new co-author". Fill in all input fields.
(ctrl+shift+p
-> "Open .git-coauthors file")
Option 2: Add your co-authors to the .git-coauthors
files in your user folder.
Add new co-authors from repository
Click the plus + button on an author in More Authors list.
Search suggested co-authors
Click the search icon on the More Authors section or CTRL+shift+p
or ⌘+⇧+p
and search for "Search suggested co-authors".
Workspace support
Select one of multiple open Git repositories and add co-author metadata to source control input field.
Git Emojis
Using the standardised list from Gitmoji.
Search and select an emoji to add to the Git message input field
Change primary author
Settings
Post commit -> Solo
After a commit remove selected co-authors from input to unselected. If you commit in the command-line the UI will update as well.
Default: false
Author list -> Expand more authors
Expand 'More Authors' tree when UI starts.
Default: true
Github -> Personal Access Token
Search for co-authors on GitHub you will need to generate a PAT.
- Visit GitHub > settings > tokens
- Click "generate new token"
- Select "user:read" (This allows GitMob to fetch a users public email)
Default: <empty>