Automated Git workflow toolkit featuring multi-language pre-commit spellchecking (codespell for German & English), rapid terminal fix routines, and comprehensive repository publishing guidelines.
- Overview
- Architecture & How It Works
- Directory Structure
- Prerequisites & Installation
- Deployment
- Configuration & Ignore Lists
- Terminal Fix Workflows
- Repository Publishing Guidelines
Documentation and commit messages frequently suffer from typos and language-mixing errors. This repository provides an automated Git pre-commit hook that scans staged text files before they enter version control, combined with terminal workflows to resolve findings within seconds.
When running git commit, the hook executes the following pipeline:
┌────────────────────────┐
│ git commit │
└───────────┬────────────┘
│
▼
┌────────────────────────┐
│ Filter Staged Files │ ──► Matches .md, .txt, .rst, .adoc
└───────────┬────────────┘
│
▼
┌────────────────────────┐
│ Run codespell │ ──► Loads dictionaries & ignore lists
└───────────┬────────────┘
│
┌──────┴──────┐
▼ ▼
[Clean / Valid] [Errors Found]
│ │
▼ ▼
Commit OK Commit rejected (Exit 1)
- Selective Scanning: Only staged modifications in text files are processed.
- Safe Path Handling: File paths are parsed with null-byte termination (
-z) to prevent whitespace issues. - Layered Dictionaries & Exclusions:
- Global German dictionary (optional):
~/.config/git/codespell_de.txt - Global ignore list:
~/.config/git/codespell_ignore - Project-local ignore list:
.codespellignoreor.codespell_ignore
- Global German dictionary (optional):
| Path | Description |
|---|---|
hooks/pre-commit |
Executable Bash pre-commit hook script |
deployment.sh |
Installation script for local or global hook deployment |
requirements.txt |
Python dependencies (codespell) |
WORKFLOW.md |
Terminal reference guide for rapid spellcheck fixes |
docs/git-publishing.md |
Comprehensive public publishing guide (English: GitHub CLI, licenses, GDPR, .gitignore) |
docs/git-publizierung.md |
Leitfaden für die Veröffentlichung von Repositories (Deutsch) |
LICENSE |
MIT Open Source License terms |
README.md |
Main repository documentation |
sudo apt update
sudo apt install codespellsudo pacman -S codespell
# Optional: German dictionary package from AUR
yay -S --needed codespell-dictionaries-gitpip install -r requirements.txt
# or isolated via pipx:
# pipx install codespellConfigures the hook globally in ~/.config/git/hooks/:
bash deployment.sh global
git config --global core.hooksPath ~/.config/git/hooksInstalls the hook inside .git/hooks/pre-commit:
bash deployment.sh local- Global Ignore List: Add terms to
~/.config/git/codespell_ignore(one word per line). - Project-Specific Ignore List: Create a
.codespellignorefile in the root of your target repository.
Detailed instructions on rapid terminal fix strategies (interactive codespell -i 3 -w, sed, ripgrep, ignore management, and emergency bypass) can be found in WORKFLOW.md.
Before publishing code publicly to GitHub or other git hosts, review our best practices covering:
- Security & Privacy: Redacting PII (GDPR/DSGVO) and company secrets.
- Clean
.gitignore: Excluding build artifacts, OS files, and environment files. - Licensing & Architecture: Choosing appropriate open-source licenses.
- GitHub CLI: Direct terminal deployment via
gh repo create.
For the complete guide, see:
- English Publishing Guide
- Deutscher Leitfaden zur Veröffentlichung
This project is licensed under the MIT License - see the LICENSE file for details.