git-cz
is a simple commitizen tool written in rust.
git-cz
helps you create conventional commits with ease.
It prompts you to select the type of commit, enter a scope (optional), and provide a summary and detailed description.
cargo install git-commitizen
[!NOTE] Although the package is called
git-commitizen
on crates.io, the installed binary is namedgit-cz
:
Check releases for pre-built binaries or compiled binary for your platform.
The Conventional Commits specification is a convention for writing consistent commit messages. It helps in automating the release process, generating changelogs, and making it easier to understand the history of a project.
A conventional commit message has the following format:
<type>(<scope>): <summary>
<body>
<footer>
type
: The type of change being committed, e.g., feat, fix, docs, etc.scope
(optional): The part of the codebase that is being affected.summary
: A brief summary of the change.body
(optional): A detailed description of the change.footer
(optional): A footer section that can contain additional information about issues fixed or closed. Benefits
Git has a feature called "Git command aliases" that allows it to treat any executable file named git-<command>
in your PATH
as a Git subcommand. This is how git-cz
works:
git cz
, Git looks for an executable file named git-cz
in the directories listed in your PATH.By naming our script git-cz
and placing it in a directory in the PATH, we're effectively creating a new Git command cz
that can be invoked as git cz
.
This approach is flexible and allows for easy installation and use across different projects without requiring project-specific configuration.
Feel free to improve the script to add your own commit types or make any other enhancements you think are useful. Contributions are welcome!
If you would like to contribute:
Your contributions can help make this tool even more useful for everyone. Thank you for considering contributing!