Skip to content

Commit automatically

After add has updated your configuration and regenerated the table, the files are changed but not committed. You can commit them yourself, or you can set commit to true in .all-contributorsrc and let the CLI do it. The init command asks about this, and you can change your answer in the configuration file at any time.

The CLI commits with Git, so run it inside a Git repository. In .all-contributorsrc, set the option and, if you like, the message style:

{
"commit": true,
"commitConvention": "angular"
}

With these settings, add stages .all-contributorsrc and the files listed under files, then commits them together. Unstaged changes in your working tree stay untouched. Anything you had already staged ends up in the same commit, though, so stage nothing else before you run add.

The commit message is the prefix of the convention you chose followed by a sentence that names the person. For a new contributor the sentence starts with “Add”, and for an existing one it starts with “Update”:

Convention Example message
angular docs: add @jane as a contributor
atom :memo: Add @jane as a contributor
gitmoji :busts_in_silhouette: Add @jane as a contributor
ember [DOC canary] Add @jane as a contributor
eslint Docs: Add @jane as a contributor
jshint [[DOCS]] Add @jane as a contributor
none Add @jane as a contributor

To use a different commit format, define commitTemplate. The template string can use prefix, which is the convention’s prefix, username, newContributor, which is true for a new contributor, and contributions:

{
"commitTemplate": "<%= prefix %> credit @<%= username %> for <%= contributions.join(', ') %>"
}