Skip to content

Commit 9c4ed82

Browse files
bpmctclaude
andcommitted
docs: add git workflow guidelines to prevent force pushing
When working on PRs, Claude Code was sometimes force pushing to branches. This adds simple git workflow guidelines emphasizing: - Check out PR branches properly (fetch, checkout, pull) - Don't use git push --force unless explicitly requested Examples of PRs with multiple commits from iterative work: - #21148: 7 commits including merge commit - #21150: 9 commits with iterative documentation changes - #21182: 4 commits with fixes - Also observed force updates on feat/add-tasks-template-flag branch 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 67024b8 commit 9c4ed82

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)