Skip to content

Commit 6005608

Browse files
bpmctclaude
andauthored
docs: add git workflow guidelines to prevent force pushing (#21207)
When working on PRs, Claude Code was sometimes force pushing to branches. This adds simple git workflow guidelines that emphasize proper branch checkout and avoiding force pushes. ## Changes Added git workflow section to `CLAUDE.md`, `AGENTS.md`, and `.claude/docs/WORKFLOWS.md` with: - Instructions to fetch, checkout, and pull before working on PR branches - Note to avoid `git push --force` unless explicitly requested ## Examples of force push behavior Observed in recent PRs: - PR #21148: 7 commits including merge commit from iterative changes - PR #21150: 9 commits with multiple documentation iterations - PR #21182: 4 commits with iterative fixes - Force update on `feat/add-tasks-template-flag` branch: `9bf7980b9...f98cf44` The guidelines now make it clear to check out branches properly and push normally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent c3224b7 commit 6005608

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.claude/docs/WORKFLOWS.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,20 @@
121121
- Use `testutil.WaitLong` for timeouts in tests
122122
- Always use `t.Parallel()` in tests
123123

124+
## Git Workflow
125+
126+
### Working on PR branches
127+
128+
When working on an existing PR branch:
129+
130+
```sh
131+
git fetch origin
132+
git checkout branch-name
133+
git pull origin branch-name
134+
```
135+
136+
Then make your changes and push normally. Don't use `git push --force` unless the user specifically asks for it.
137+
124138
## Commit Style
125139

126140
- Follow [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/)

AGENTS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ app, err := api.Database.GetOAuth2ProviderAppByClientID(ctx, clientID)
103103

104104
### Full workflows available in imported WORKFLOWS.md
105105

106+
### Git Workflow
107+
108+
When working on existing PRs, check out the branch first:
109+
110+
```sh
111+
git fetch origin
112+
git checkout branch-name
113+
git pull origin branch-name
114+
```
115+
116+
Don't use `git push --force` unless explicitly requested.
117+
106118
### New Feature Checklist
107119

108120
- [ ] Run `git pull` to ensure latest code

0 commit comments

Comments
 (0)