if ! grep -q -E "$pattern" "$message_file"; then echo "ERROR: Commit message does not follow Conventional Commits format." echo "Expected: <type>(<scope>): <subject>" echo "Example: feat(auth): add OAuth2 provider" exit 1 fi

Located in .git/hooks/commit-msg (or .git/hooks/commit-msg.sample to start), this script can read, validate, or even modify the COMMIT-EDITMSG file before the commit is finalized. You want every commit message to follow the Conventional Commits standard (e.g., feat: add login , fix: resolve null pointer ).

The humble text file changes everything.

Using a prepare-commit-msg hook (a cousin that runs before the editor opens), you can read the branch name and append the ticket to COMMIT-EDITMSG :


Commit-editmsg -

if ! grep -q -E "$pattern" "$message_file"; then echo "ERROR: Commit message does not follow Conventional Commits format." echo "Expected: <type>(<scope>): <subject>" echo "Example: feat(auth): add OAuth2 provider" exit 1 fi

Located in .git/hooks/commit-msg (or .git/hooks/commit-msg.sample to start), this script can read, validate, or even modify the COMMIT-EDITMSG file before the commit is finalized. You want every commit message to follow the Conventional Commits standard (e.g., feat: add login , fix: resolve null pointer ). COMMIT-EDITMSG

The humble text file changes everything. this script can read

Using a prepare-commit-msg hook (a cousin that runs before the editor opens), you can read the branch name and append the ticket to COMMIT-EDITMSG : feat: add login

Follow by Email
Twitter
Instagram
Tiktok
X
0
    0
    Mon panier
    Votre panier est videRetour à la boutique