git-pull-after-squash-mergelisted
Install: claude install-skill wan-huiyan/agent-traffic-control
# Fix git pull After Squash Merge
## Problem
After a PR is squash-merged to main, switching branches or pulling fails with:
```
error: The following untracked working tree files would be overwritten by merge:
data/results/experiment_1.json
data/results/experiment_2.json
docs/findings/analysis.html
Please move or remove them before you merge.
```
These files ARE on main (from the squash merge) but git sees them as untracked locally because squash merge creates a new commit hash — the original branch commits never appear in main's history.
## Context / Trigger Conditions
This happens when:
- A branch created new files (not just modified existing ones)
- The branch was **squash-merged** (not regular merge) to main
- You're on a different local branch that also has those files (from cherry-picks, worktree remnants, or the original branch)
- `git pull` or `git checkout main` refuses to proceed
Common scenarios:
- Working on branch B while branch A (which created new files) gets squash-merged
- Checking out main after a parallel session merged files you also have locally
- Multiple Claude Code sessions creating overlapping experiment result files
## Solution
> **⚠️ Safety first — diff CONTENT, not just existence, before removing.** An
> untracked file that *exists* on main is not necessarily *identical* to your
> local copy. A long-stale branch's local copy often has unique edits (a 1-line
> SHA reference, a draft note). Blindly `rm`-ing / `git clean -fd` / `re