Sometimes git can be as dark and mysterious as Dan Brown’s popularity as a novelist. I was struggling with retrieving a newly created remote branch:
git checkout –track -b screensizes origin/screensizes
Which rendered:
fatal: git checkout: updating paths is incompatible with switching branches/forcing
Which is as clear as mud. Googling was fruitless until I found this suggestion:
[Switch to the root directory that your tracking]
$ git checkout -f master
$ git pull
(Note: this errored for me, since I haven’t established nicknames)
$ git checkout --track -b
Then worked. Dunno why, but worth a shot if your stuck on this mesage.

You are my saviour!
Thanks!
It’s –track instead of -track. Also, –track has to be passed before -b.
So it’s => git checkout –track -b
i.e. => git checkout –track -b new_branch origin/new_branch
Looks like I’ll have to use html character codes…
It’s --track instead of -track. Also, --track has to be passed before -b.
So it’s => git checkout --track -b <new_local_branch> <start_point>
i.e. => git checkout --track -b new_branch origin/new_branch
Oh, as for the reason it worked, it was due to the “git pull” you did. Switching to master should not have mattered. Even though you could see the remote branch with a “git branch -r”, you still have to issue a “git pull” (from any branch) to pull in the latest listing of remote branches to your local repo. Then you can checkout the new remote branch.
Just a note: if you want to track a branch from another repo than origin, you have to issue a
git fetch reponame
before. Just happened to me…
Thanks for this, sort of makes sense in hindsight but not at all obvious.