Skip to content

Commit 03be955

Browse files
sarbbottamjimthedev
authored andcommitted
docs(usage): conventional commit messages as a global utility (#209)
1 parent bdea0db commit 03be955

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,34 @@ When you're working in a Commitizen friendly repository, you'll be prompted to f
2020

2121
If you're not working in a Commitizen friendly repository, then `git cz` will work just the same as `git commit`.
2222

23+
#### Conventional commit messages as a global utility
24+
25+
Install `commitizen` globally, if you have not already.
26+
27+
```
28+
npm install -g commitizen
29+
```
30+
31+
Install your preferred `commitizen` adapter globally, for example [`cz-conventional-changelog`](https://www.npmjs.com/package/cz-conventional-changelog)
32+
33+
```
34+
npm i -g cz-conventional-changelog
35+
```
36+
37+
Create a `.czrc` file in your `home` directory, with `path` referring to the preferred, globally installed, `commitizen` adapter
38+
39+
```
40+
echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc
41+
```
42+
43+
You are all set! Now `cd`into any `git` repository and use `git cz` instead of `git commit` and you will find the `commitizen` prompt.
44+
45+
Protip: You can use all the `git commit` `options` with `git cz`, for example: `git cz -a`.
46+
47+
>If your repository is a [nodejs](https://nodejs.org/en/) project, making it [Commitizen-friendly](#making-your-repo-commitizen-friendly) is super easy.
48+
49+
If your repository is already [Commitizen-friendly](#making-your-repo-commitizen-friendly), the local `commitizen` adapter will be used, instead of globally installed one.
50+
2351
### Commitizen for project maintainers
2452
As a project maintainer, making your repo Commitizen friendly allows you to select pre-existing commit message conventions or to create your own custom commit message convention. When a contributor to your repo uses Commitizen, they will be prompted for the correct fields at commit time.
2553

0 commit comments

Comments
 (0)