---
# System prepended metadata

title: Git conventional commit related packages & guides

---

# Git conventional commit related packages & guides

:::info
**RELATED PACKAGES**
* [Node.js](https://nodejs.org/en/)
* [commitlint](https://commitlint.js.org/#/)
* [husky](https://github.com/typicode/husky)
* [commitizen](https://github.com/commitizen/cz-cli)
* [standard-version](https://github.com/conventional-changelog/standard-version)
:::
`commitlint` helps team adhering to a commit convention. By supporting npm-installed configurations it makes sharing of commit conventions easy.
`@commitlint/cli` is the tool to execute commitlint and `@commitlint/config-conventional` is the regulation based on conventinal commit.
```bash!
npm install -g @commitlint/cli @commitlint/config-conventional
```

After the installation, we need th export the modulet into our project.

```bash!
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
```

`husky` use shell script to automatically check wheather the commit is correct 
under conventional commit. it can use hook to set the checkpoint. for example,
check the commit message before commitment.

```bash!
npx husky-init ; npm install
```
add the hook.
```bash!
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit $1'
```
```bash!
npx commitizen init cz-conventional-changelog --save-dev --save-exact
```
`commitizen` is a package to create a conventional commit template

```bash!
npx cz
```
![](https://i.imgur.com/HdubdGb.png)


automatically update a changelog, it will changed the project version based
on commit type according to semver principle.
[What is semver principle](https://medium.com/fiverr-engineering/major-minor-patch-a5298e2e1798)
type:
feat(new features) : change minor version
fix (bug fix) : change patch version

```json
"release": "npx standard-version",
```

You can add the above command into package.json scirpts dictionary, so that 
the below command can be used.
![](https://i.imgur.com/H5wl4oO.png)

```bash!
npm run release
```

after the release the CHANGELOG.md will be updated and then can push to Github.

![](https://i.imgur.com/4ofho2s.png)
