From 9c4ed823eaf21cd06c92c5c251d34fdff518cc83 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Wed, 10 Dec 2025 15:18:14 +0000 Subject: [PATCH] docs: add git workflow guidelines to prevent force pushing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .claude/docs/WORKFLOWS.md | 14 ++++++++++++++ AGENTS.md | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.claude/docs/WORKFLOWS.md b/.claude/docs/WORKFLOWS.md index 4e9dfb78599ee..9fdd2ff5971e7 100644 --- a/.claude/docs/WORKFLOWS.md +++ b/.claude/docs/WORKFLOWS.md @@ -121,6 +121,20 @@ - Use `testutil.WaitLong` for timeouts in tests - Always use `t.Parallel()` in tests +## Git Workflow + +### Working on PR branches + +When working on an existing PR branch: + +```sh +git fetch origin +git checkout branch-name +git pull origin branch-name +``` + +Then make your changes and push normally. Don't use `git push --force` unless the user specifically asks for it. + ## Commit Style - Follow [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) diff --git a/AGENTS.md b/AGENTS.md index 2c055551ed4d6..9cdb31a125cac 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -103,6 +103,18 @@ app, err := api.Database.GetOAuth2ProviderAppByClientID(ctx, clientID) ### Full workflows available in imported WORKFLOWS.md +### Git Workflow + +When working on existing PRs, check out the branch first: + +```sh +git fetch origin +git checkout branch-name +git pull origin branch-name +``` + +Don't use `git push --force` unless explicitly requested. + ### New Feature Checklist - [ ] Run `git pull` to ensure latest code