Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitmoji_hook

Gitmoji

Git hook with Gitmoji

Features

  1. Change merge commit messages to Gitmoji style. 2024-07-25 00_23_32-2024-07-24 23_51_41-Greenshot png
  2. The hook uses only the shell already expected by language: script; it does not install a hook-specific runtime or package.

Remote installation with pre-commit

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-msg

Install the prepare-commit-msg hook type and then commit normally:

pre-commit install --hook-type prepare-commit-msg

The 🔀 Gitmoji is added when Git generates a merge message beginning with Merge branch. This follows the Gitmoji convention for merging branches; see gitmoji.dev.

Local verification

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=%s

The final subject should begin with 🔀 Merge branch.

Releases

Packages

Used by

Contributors

Languages