@@ -12,59 +12,100 @@ Run the following command once after cloning the repository:
1212
1313``` bash
1414git config core.hooksPath .githooks
15-
1615```
1716
18- Verify:
17+ Verify the configuration :
1918
19+ ``` bash
2020git config core.hooksPath
21+ ```
2122
2223Expected output:
2324
25+ ``` text
2426.githooks
27+ ```
2528
2629---
2730
28- Installed Hooks
31+ ### Installed Hooks
2932
30- Hook| Purpose
31- "commit-msg"| Removes automatically generated "Co-authored-by: Cursor ..." trailers before commit finalization
32- "prepare-commit-msg"| Performs the same cleanup earlier in the commit creation flow (best effort)
33+ | Hook | Purpose |
34+ | ---| ---|
35+ | ` commit-msg ` | Removes automatically generated ` Co-authored-by: Cursor ... ` trailers before commit finalization |
36+ | ` prepare-commit-msg ` | Performs the same cleanup earlier in the commit creation flow (best effort) |
3337
3438---
3539
36- Why This Exists
40+ ### Hook Workflow
41+
42+ ``` text
43+ Create Commit
44+ ↓
45+ prepare-commit-msg
46+ ↓
47+ Edit Commit Message
48+ ↓
49+ commit-msg
50+ ↓
51+ Commit Finalized
52+ ```
53+
54+ ---
55+
56+ ### Why This Exists
3757
3858These hooks help maintain:
3959
4060- Consistent commit history
4161- Cleaner repository metadata
4262- Reduced commit message noise
4363- Predictable contributor workflows
64+ - Repository-wide commit standards
4465
45- The hooks only modify commit message metadata and do not alter source files.
66+ The hooks only modify commit message metadata and never alter project source files.
4667
4768---
4869
49- Disable Hooks
70+ ### Disable Hooks
5071
51- To revert to Git’s default hook location:
72+ To restore Git’s default hook location:
5273
74+ ``` bash
5375git config --unset core.hooksPath
76+ ```
5477
5578---
5679
57- Repository Structure
80+ ### Repository Structure
5881
82+ ``` text
5983.githooks/
6084├── commit-msg
6185└── prepare-commit-msg
86+ ```
6287
6388---
6489
65- Notes
90+ ### Notes
6691
67- - Hooks are executed locally by Git.
92+ - Hooks run locally and are executed by Git.
6893- Hooks are not automatically enabled after cloning.
6994- Each contributor must enable hooks once per local repository clone.
70- - Hook execution behavior may vary slightly across operating systems and Git versions.
95+ - Hook execution may vary slightly across operating systems and Git versions.
96+
97+ ---
98+
99+ ### Validation
100+
101+ You can confirm hooks are active using:
102+
103+ ``` bash
104+ git config --get core.hooksPath
105+ ```
106+
107+ Expected result:
108+
109+ ``` text
110+ .githooks
111+ ```
0 commit comments