Git checkout: updating paths is incompatible with switching branches

后端 未结 11 889
你的背包
你的背包 2020-11-27 08:48

My problem is related to Fatal Git error when switching branch.

I try to fetch a remote branch with the command

git checkout -b local-name origin/rem         


        
11条回答
  •  无人及你
    2020-11-27 09:35

    Could your issue be linked to this other SO question "checkout problem"?

    i.e.: a problem related to:

    • an old version of Git
    • a curious checkout syntax, which should be: git checkout -b [] [], with [] referring to the name of a commit at which to start the new branch, and 'origin/remote-name' is not that.
      (whereas git branch does support a start_point being the name of a remote branch)

    Note: what the checkout.sh script says is:

      if test '' != "$newbranch$force$merge"
      then
        die "git checkout: updating paths is incompatible with switching branches/forcing$hint"
      fi
    

    It is like the syntax git checkout -b [] [remote_branch_name] was both renaming the branch and resetting the new starting point of the new branch, which is deemed incompatible.

提交回复
热议问题