The Prompt BakeryTemplates and prompts

Fix · GitHub and Git

"Your local changes would be overwritten" when pulling or switching

What you may see

  • Pull or switch branch is blocked because I have unsaved edits
  • Git tells me to commit or stash

Most likely cause

You have edits that are not saved as a commit, and the incoming change touches the same files.

Check first (about two minutes)

  1. Run git status to see which files have edits.

The fix prompt

What you type here never leaves your browser. The search runs on this page, and nothing is sent to a server or to an AI.

Kept only in this browser, on this device. Keys and passwords are removed before anything is saved.

Prompt language

Paste it into Claude, ChatGPT, Gemini or Cursor, then follow what it says.

After you tried it, did it work?

Steps

  1. Run git status and git diff --stat and show me.
  2. Save my edits safely: either git add -A and git commit -m "work in progress", or git stash push -m "before pull". Ask me which I prefer.
  3. Do the pull or the branch switch.
  4. If I used stash, bring the edits back with git stash pop and help with any conflict.

Do not do this

  • Do not delete files by hand to silence the message.
  • Do not run git checkout -- . or git reset --hard (they erase my edits).

Related

Try another entry

How can we help?

What do you need?
Your email, so we can reply (optional)Only enter your own email. We reply there.