Skip to content

Commit 276aacc

Browse files
Update README.md
1 parent fd6fec9 commit 276aacc

1 file changed

Lines changed: 59 additions & 8 deletions

File tree

.githooks/README.md

Lines changed: 59 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,68 @@
1-
## Repo git hooks
1+
## Repository Git Hooks
22

3-
This repository keeps git hooks in `.githooks/`.
3+
This repository uses **project-managed Git hooks** stored in `.githooks/` to enforce lightweight repository standards and maintain a clean commit history.
44

5-
### Enable
5+
Git hooks are version-controlled so contributors share the same commit workflow and repository behavior.
66

7-
Run this once in the repo:
7+
---
8+
9+
### Enable Hooks
10+
11+
Run the following command once after cloning the repository:
812

913
```bash
1014
git config core.hooksPath .githooks
11-
```
1215

13-
### What it does
16+
Verify:
17+
18+
git config core.hooksPath
19+
20+
Expected output:
21+
22+
.githooks
23+
24+
---
25+
26+
Installed Hooks
27+
28+
Hook| Purpose
29+
"commit-msg"| Removes automatically generated "Co-authored-by: Cursor ..." trailers before commit finalization
30+
"prepare-commit-msg"| Performs the same cleanup earlier in the commit creation flow (best effort)
31+
32+
---
33+
34+
Why This Exists
35+
36+
These hooks help maintain:
37+
38+
- Consistent commit history
39+
- Cleaner repository metadata
40+
- Reduced commit message noise
41+
- Predictable contributor workflows
42+
43+
The hooks only modify commit message metadata and do not alter source files.
44+
45+
---
46+
47+
Disable Hooks
48+
49+
To revert to Git’s default hook location:
50+
51+
git config --unset core.hooksPath
52+
53+
---
54+
55+
Repository Structure
56+
57+
.githooks/
58+
├── commit-msg
59+
└── prepare-commit-msg
60+
61+
---
1462

15-
- `commit-msg`: removes any `Co-authored-by: Cursor ...` trailer lines from commit messages.
16-
- `prepare-commit-msg`: same removal earlier in the flow (best-effort).
63+
Notes
1764

65+
- Hooks are executed locally by Git.
66+
- Hooks are not automatically enabled after cloning.
67+
- Each contributor must enable hooks once per local repository clone.
68+
- Hook execution behavior may vary slightly across operating systems and Git versions.

0 commit comments

Comments
 (0)