0

I merged branch Foo into Bar, and now local branch Bar is corrupt and will not allow me to switch to other branches due to error: The following untracked working tree files would be overwritten by checkout. I have attempted to checkout the files from the working branch and delete the files, hard reset to a previous state, pull from origin/Bar; all attempts result in the same error on an attempt to switch branches.

Any advice on this?

tseboho
  • 77
  • 10

1 Answers1

0

You could try and clean your untracked files first.

# first preview
git clean -n -d
# then clean
git clean -f -d

From git checkout, check also if a simple git checkout -f Foo wouldn't work.

If everything else fail, clone the repo again, and see if you can switch branch in that new local clone.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • The dry run doesn't reveal any change to be happening, and the second forced clean attempt does not change anything. All the files are still shown as being in the working directory as untracked on running git status, and checkout is still aborting. Its really peculiar. – tseboho Nov 26 '14 at 07:29
  • @tsiiiboho then any chance you could clone that repo, and try to sitch branch in the new local clone? – VonC Nov 26 '14 at 07:37
  • I believe that might be my only option at this stage. Thank you for your help. – tseboho Nov 26 '14 at 07:40