warning: refname 'the_branch' is ambiguous.网上查到的结果通常都是说存在近似同名 ref(标签或分支,在 .git/refs 目录下),通过
git show-ref 可以查到。我的情况比较特殊(和 Magnus 一样),原因在于错误地执行了:git update-ref the_branch <newvalue>其结果是在 .git 目录下生成
the_branch 路径,这很难找到。正确的命令是:git update-ref refs/heads/the_branch <newvalue>我原来是打算在不切换分支的前提下设置其他分支引用,事实证明看 Stack Overflow 还是要多往下翻,正确的做法是:
git branch -f <branchname> [<start-point>]#git