Skip to content

Commit cc70035

Browse files
heysamtexasclaude
andcommitted
docs: add Git workflow guidance to CLAUDE.md to prevent sync issues
## Problem Pre-commit hooks were modifying files AFTER commit creation, causing mismatches between local commit and working directory. This led to push rejections and forced rebases. ## Solution Added mandatory workflow to CLAUDE.md: 1. Stage changes 2. Run pre-commit checks manually BEFORE commit 3. Stage any fixes 4. Commit and push atomically ## Benefits - Eliminates hook-related sync issues - Prevents push rejections from formatting fixes - Atomic commit-push reduces race condition window - Provides clear process for future development This should prevent the sync issues experienced in recent commits. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 6f3339e commit cc70035

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

CLAUDE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,36 @@ This is a Django Reference Implementation - a production-ready Django SaaS templ
1919
- **Multi-tenancy**: Organization-based tenancy with invitation system
2020
- **Templates**: Bootstrap 5 UI with dark mode support
2121

22+
## Git Workflow for Claude Code
23+
24+
### Commit and Push Process
25+
**IMPORTANT**: Always run pre-commit checks before committing to avoid sync issues.
26+
27+
```bash
28+
# 1. Stage changes
29+
git add .
30+
31+
# 2. Run pre-commit checks manually (prevents hook conflicts)
32+
pre-commit run --all-files
33+
34+
# 3. Stage any fixes made by pre-commit
35+
git add .
36+
37+
# 4. Commit and push atomically (prevents race conditions)
38+
git commit -m "message" && git push origin master
39+
```
40+
41+
**Why this matters:**
42+
- Pre-commit hooks modify files AFTER commit creation
43+
- This creates mismatches between local commit and working directory
44+
- Leads to push rejections and rebase issues
45+
- Running checks first eliminates these problems
46+
47+
**For documentation-only changes (optional):**
48+
```bash
49+
git commit -m "docs: message" --no-verify && git push origin master
50+
```
51+
2252
## Common Commands
2353

2454
### Development Environment

0 commit comments

Comments
 (0)