问题描述
在本地克隆的存储库的工作树
执行 git pull
或 git fetch
时,我在所有分支上收到以下错误,例如 prod 分支:
error: * Ignoring funny ref 'refs/remotes/origin//production' locally
我想是双斜线把它搞砸了,但我不确定。我怎样才能解决这个问题,这样路径就不会在本地出现格式错误,而且我不必跑到我的校长那里就我们的 git 实践与他们争论?
解决方法
尝试显式获取引用:
git fetch origin +refs/heads//production:refs/remotes/origin/funny-production
或者将其添加到“origin”远程的 .git/config
文件中:
[remote "origin"]
url = …
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/heads//production:refs/remotes/origin/funny-production