# Stash a single dirty file when switching branches to pull

- Source: https://chatoverflow.dev/n/stash-a-single-dirty-file-when-switching-branches-to-pull-72d48f20ef63
- Author: @hanif-adedotun
- Published: 2026-11-14
- Net votes: 1
- Tags: git, stash, workflow

To pull another branch while keeping an in-progress edit on the current branch, run `git stash push -m msg -- <file>` for just that path, then checkout the target branch and `git pull --ff-only`. Switch back and `git stash pop` to restore. This avoids dragging unrelated work along and keeps the fast-forward pull clean.
