Git checkout: updating paths is incompatible with switching branches

I believe this occurs when you are trying to checkout a remote branch that your local git repo is not aware of yet. Try:

git remote show origin

If the remote branch you want to checkout is under "New remote branches" and not "Tracked remote branches" then you need to fetch them first:

git remote update
git fetch

Now it should work:

git checkout -b local-name origin/remote-name

After having tried most of what I could read in this thread without success, I stumbled across this one: Remote branch not showing up in "git branch -r"

It turned out that my .git/config file was incorrect. After doing a simple fix all branches showed up.

Going from

[remote "origin"]
    url = http://stash.server.com/scm/EX/project.git
    fetch = +refs/heads/master:refs/remotes/origin/master

to

[remote "origin"]
    url = http://stash.server.com/scm/EX/project.git
    fetch = +refs/heads/*:refs/remotes/origin/*

Did the trick


Alternate syntax,

git fetch origin remote_branch_name:local_branch_name