Skip to content

Mirror of the: https://codeberg.org/rch/git-commit-guidelines. A complete toolkit for enforcing Conventional Commits with validation hooks, templates, and style guides.

License

Notifications You must be signed in to change notification settings

rchar01/git-commit-guidelines

Repository files navigation

Commit Guidelines Repository

This repository bootstraps itself: It uses its own templates (templates/*) applied to root files (.gitmessage, CONTRIBUTING.md, etc.) and provides reusable tooling for other projects.

What This Repo Provides

  • Executable hooks to enforce Conventional Commits
  • Templates you can copy to another project
  • Self-documenting examples: Root files show the templates in action

Quickstart (Use in Another Repository)

1. Copy Core Templates

cp templates/.gitmessage.template .gitmessage
cp templates/CONTRIBUTING.template.md CONTRIBUTING.md
cp templates/CODESTYLE.template.md CODESTYLE.md
cp templates/.gitattributes.template .gitattributes

2. Install Commit Hook

cp hooks/commit-msg .git/hooks/commit-msg
chmod +x .git/hooks/commit-msg

# Copy validator (POSIX sh recommended)
mkdir -p scripts
cp scripts/verify-commit-msg.sh scripts/

3. Configure Git

git config commit.template .gitmessage

How This Repo Uses Its Own Templates

The root files are generated from templates:

  • .gitmessagetemplates/.gitmessage.template
  • CONTRIBUTING.mdtemplates/CONTRIBUTING.template.md
  • CODESTYLE.mdtemplates/CODESTYLE.template.md

This demonstrates the templates work and provides a live example.

Relationship to Conventional Commits

This toolkit implements and enforces the Conventional Commits specification with:

Executable validation of commit messages Stricter rules: 50-char subject limit, specific allowed types Complete templates: Issue templates, code style guides Batteries-included: Ready-to-use commit hooks and configurations

What's the same: The commit format <type>(scope): <subject> and core types (feat, fix, docs, etc.) align with the spec.

What's different: We add tooling, validation, and stricter rules.

Adoption Methods

A. Copy Files (Recommended)

See Quickstart above.

B. Git Submodule

git submodule add <url> commit-guidelines
# Then copy templates as needed

C. Git Subtree

git subtree add --prefix commit-guidelines <url> main --squash

Notes

  • The commit hook must be manually installed in .git/hooks/
  • Configure your editor to follow CODESTYLE.md rules
  • See CONTRIBUTING.md for how this repo follows its own rules

License

See LICENSE.

About

Mirror of the: https://codeberg.org/rch/git-commit-guidelines. A complete toolkit for enforcing Conventional Commits with validation hooks, templates, and style guides.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Languages