fatal: git checkout: updating paths is incompatible with switching branches.
Using GIT I tried to pull down a new remote branch using:
git checkout --track -b my-branch-name origin/my-branch-name
When I did this I got this error message:
fatal: git checkout: updating paths is incompatible with switching branches. Did you intend to checkout 'origin/my-branch-name' which can not be resolved as commit?
This error message was a tad confusing. The solution in my case was simple though, apparently you can’t switch to a different remote branch if your local master is not up-to-date with the remote origin/master so performing:
git pull
resolved the issue and after this I was able to successfully pull down the remote branch.
Comments
3 Comments
Great! Thanks! The error message was definitely confusing, but pulling first worked for me too. Thank you.
Cheers for this! Such a simple solution, but just what I needed.
Oh man thanks so much, i’ve been looking for a solution to this for a whole freaking day without success.
you saved me lot of time
Leave a Comment