---
description: RED FLAG — sync via pull/push; never redo work across machines/cloud agents
alwaysApply: true
---

# Git sync — no redo, no messy merges

User preference (hard): keep git history clean. Prefer fast-forward. Hate merge-conflict cleanup.

## Before editing on a checkout
1. `git fetch` + `git status`.
2. If behind origin: `git pull --ff-only`.
3. If local WIP overlaps remote: stash → ff-only pull → stash pop (or commit on one side first).
4. If another machine/cloud agent already did the work: **pull it — do not re-implement**.

## Raise the red flag and stop when
- A cloud agent or relocated workspace is about to redo the same change set instead of pulling.
- Local dirty files overlap the same paths as unpulled remote commits.
- Workspace path changed and the base looks stale vs origin.
- A merge commit / conflict soup would be needed that clean pull/push would have avoided.

Tell the user clearly. Propose stash → ff-only pull → reapply (or commit-then-pull on one side). Do not invent parallel implementations of the same feature.

## Also
- Ask ≠ act: questions get answers; only edit/commit/push when clearly requested.
