Git checkout: updating paths is incompatible with switching branches

后端 未结 11 890
你的背包
你的背包 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:24

    It's not very intuitive but this works well for me ...

      mkdir remote.git & cd remote.git & git init
      git remote add origin $REPO
      git fetch origin $BRANCH:refs/remotes/origin/$BRANCH        
    

    THEN run the git branch --track command ...

      git branch --track $BRANCH origin/$BRANCH
    

提交回复
热议问题