Git hook with Gitmoji
- Change merge commit messages to Gitmoji style.

- The hook uses only the shell already expected by
language: script; it does not install a hook-specific runtime or package.
Install pre-commit once if it is not already available. Then add this repository as a normal remote hook in your project's .pre-commit-config.yaml:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
exclude: \.md$
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- repo: https://github.com/we684123/gitmoji_hook
rev: v0.2.0
hooks:
- id: gitmoji-merge-commit-msgInstall the prepare-commit-msg hook type and then commit normally:
pre-commit install --hook-type prepare-commit-msgThe 🔀 Gitmoji is added when Git generates a merge message beginning with Merge branch. This follows the Gitmoji convention for merging branches; see gitmoji.dev.
To verify the online hook in a fresh repository:
git init
pre-commit install --hook-type prepare-commit-msg
git checkout -b feature
git checkout main
git merge --no-ff feature
git log -1 --format=%sThe final subject should begin with 🔀 Merge branch.