Last active
February 2, 2021 11:26
-
-
Save vogelino/06b71c1c91734906136e8ecbb4ec9e9b to your computer and use it in GitHub Desktop.
A function that executes commitizen's git-cz command or installs it if not present (using npm)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Commit using commitizen | |
commit-with-commitizen() { | |
if [[ $(command-exists "git-cz") -eq 0 ]]; then | |
npm install --global commitizen | |
fi | |
git-cz | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This ZSH function that checks if commitizen is installed globally, install it if not and then uses commitizen to commit.
Optional: Add an alias to always commit using commitizen
Add this alias to your
.zshrc