Ambiguous Names with GIT?

后端 未结 3 749
灰色年华
灰色年华 2021-01-03 00:08

I\'m trying to check out one of my local branches, named TEAM20-lab2-release. When I try to do this, I get an ambiguous refname error:

$ git branch TEAM20-l         


        
3条回答
  •  星月不相逢
    2021-01-03 01:10

    to get you started locating ambiguous refs

    function branchid() 
    { 
        echo $(basename "$(dirname "$1")")/$(basename "$1"); 
    }
    
    for ref in $(git for-each-ref | cut -f2)
        do echo -e "$ref\t$(branchid "$ref")"
    done | 
        sort --key 2 | uniq -Df 2
    

提交回复
热议问题