DEV Community

Yuto
Yuto

Posted on

11 1

How to use Commitizen - Unify commit messages

Introduction

  • I often get lost when entering a commit message
  • Commit messages are not unified and not simple

Due to such concerns, I have introduced Commitizen this time.

What is Commitizen?

Official page
https://github.com/commitizen/cz-cli

Type 'git cz' to see your choices.
It's a tool that allows you to create simple and easy-to-understand commit messages just by answering interactively.
スクリーンショット 2021-01-30 15.39.55

How to install Commitizen

Type this commands



npm install commitizen -g
npm install -g cz-conventional-changelog
echo '{ "path": "cz-conventional-changelog" }' >> ~/.czrc
exec $SHELL -l


Enter fullscreen mode Exit fullscreen mode

How to use Commitizen

Start with the 'git cz' command.



git cz


Enter fullscreen mode Exit fullscreen mode

スクリーンショット 2021-01-30 15.39.55

This time I just added README.md, so select 'docs'.
スクリーンショット 2021-01-30 15.40.08

I was asked for the scope of this change, so type in 'README.md'.
スクリーンショット 2021-01-30 15.40.24

Then enter a short description.
This time I typed 'add README'.
スクリーンショット 2021-01-30 15.40.38

Then enter a long description.
I didn't need a detailed explanation this time, so I skipped it with Enter Key.
スクリーンショット 2021-01-30 15.40.51

I was asked if there were any breaking changes, but this time it's no.
スクリーンショット 2021-01-30 15.41.02

I was asked if it was related to the issue, but this is No.
スクリーンショット 2021-01-30 15.41.13

That's it.
Let's see what kind of commit message was created.



docs (readme.md): add README  


Enter fullscreen mode Exit fullscreen mode

スクリーンショット 2021-01-30 15.41.39

Conclusion

That's how to use Commitizen.
Thank you for watching.

Please follow me on Twitter.
If you have a project, please contact me on Twitter.
https://twitter.com/n199603

Image of Quadratic

Free AI chart generator

Upload data, describe your vision, and get Python-powered, AI-generated charts instantly.

Try Quadratic free

Top comments (1)

Collapse
 
evgenyhalvin profile image
Eugene

thank you!

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup 🚀

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, cherished by the supportive DEV Community. Coders of every background are encouraged to bring their perspectives and bolster our collective wisdom.

A sincere “thank you” often brightens someone’s day—share yours in the comments below!

On DEV, the act of sharing knowledge eases our journey and forges stronger community ties. Found value in this? A quick thank-you to the author can make a world of difference.

Okay