3

Error message:

fatal: git checkout: updating paths is incompatible with switching branches/forcing

How to get past this Git checkout error?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

2 Answers2

2

By explicitly specifying “git checkout HEAD $blah” instead of just saying “git checkout $blah”, assuming you did want to check out a file.

You don’t say what you were trying nor what you typed, however, so no one can give you anything but a blind guess.

Aristotle Pagaltzis
  • 112,955
  • 23
  • 98
  • 97
1

When I encounter this message, it is because I have tried to do git checkout -f $blah, expecting to throw away local changes, as described in git checkout --help.

Instead, I use rm $blah && git checkout $blah to throw away local changes.

  • I had to do the same thing when trying to --track a branch in a directory that was already --tracking another branch. Still not sure how to track two branches in one directory. – Daniel Gill Sep 26 '09 at 17:41