Skip to content

Commit b93af4a

Browse files
committed
docs(cli): Add initial readme based docs
Initially we'll have docs that are generated via jsonp from the README.md file.
1 parent c253cab commit b93af4a

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
### Commitizen for contributors
2+
When you commit with Commitizen, you'll be prompted to fill out any required commit fields at commit time. No more waiting until later for a git commit hook to run and reject your commit. No more digging through CONTRIBUTING.md to find what the preferred format is. Get instant feedback on your commit message formatting and be prompted for required fields.
3+
4+
#### Installing the command line tool
5+
Installation is as simple as running the following command (add sudo if on OSX/Linux):
6+
7+
```
8+
npm install -g commitizen
9+
```
10+
11+
#### Using the command line tool
12+
Now, simply use `git cz` instead of `git commit` when committing.
13+
14+
When you're working in a Commitizen friendly repository, you'll be prompted to fill in any required fields and your commit messages will be formatted according to the the standards defined by project maintainers. If you're not working in a Commitizen friendly repository, then `git cz` will work just the same as `git commit`.
15+
16+
### Commitizen for project maintainers
17+
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.
18+
19+
#### Making your repo Commitizen-friendly
20+
21+
For this example, we'll be setting up our repo to use [AngularJS's commit message convention](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines) also known as [conventional-changelog](https://github.com/ajoslin/conventional-changelog).
22+
23+
First, install the Commitizen conventional-changelog adapter into your project.
24+
25+
```
26+
npm install cz-conventional-changelog
27+
```
28+
29+
Then just add **.cz.json** to the root of your repository with the following contents:
30+
31+
```json
32+
{
33+
"path": "node_modules/cz-conventional-changelog/"
34+
}
35+
```
36+
37+
This just tells Commitizen which adapter we actually want our contributors to use when they try to commit to this repo.
38+
39+
#### Congratulations your repo is Commitizen-friendly. Time to flaunt it!
40+
41+
Add the Commitizen-friendly badge to your README using the following markdown:
42+
```
43+
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
44+
```
45+
46+
Your badge will look like this:
47+
48+
[![Commitizen-friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
49+
50+
It may also make sense to change your README.md or CONTRIBUTING.md to include or link to the Commitizen project so that your new contributors may learn more about installing and using Commitizen.
51+
52+
### Philosophy
53+
54+
#### About Commitizen
55+
Commitizen is an open source project that helps contributors be good open source citizens. It accomplishes this by prompting them to follow commit message conventions at commit time. It also empowers project maintainers to create or use predefined commit message conventions in their repos to better communicate their expectations to potential contributors.
56+
57+
#### Commitizen or Commit Hooks
58+
Both! Commitizen is not meant to be a replacement for git commit hooks. Rather, it is meant to work side-by-side with them to ensure a consistent and positive experience for your contributors. Commitizen treats the commit command as a declarative action. The contributor is declaring that they wish to contribute to your project. It is up to you as the maintainer to define what rules they should be following.
59+
60+
We accomplish this by letting you define which adapter you'd like to use in your project. Adapters just allow multiple projects to share the same commit message conventions. A good example of an adapter is the cz-conventional-commit adapter.
61+
62+
### Authors and Contributors
63+
Jim Cummins (@JimTheDev)

0 commit comments

Comments
 (0)