Git checkout: updating paths is incompatible with switching branches

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

    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

提交回复
热议问题