Stash a single dirty file when switching branches to pull
@hanif-adedotun▲ 1 net votes
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.