我在 TFS 女士上创建了一个分支,并尝试使用代码将其拉到我的本地计算机上:
git fetch
这是获取的结果:
error: cannot update the ref 'refs/remotes/origin/tryYourself/192RestService': unable to create directory for '.git/logs/refs/remotes/origin/tryYourself/192RestService': No such file or directory
From "url"
! [new branch] tryYourself/192RestService -> origin/tryYourself/192RestService (unable to update local ref)
然后我在 Google 和 StackOverflow 上搜索了它,他们告诉我这样做:
git gc --prune=now
还有:
git remote prune origin
然后我又做了:
git fetch
所以我可以在该分支上工作,但它会返回如上所述的结果/错误。
有人有建议吗?
git fetch
的用户具有写入权限
您的本地存储库。refs/remotes/origin/tryYourself/
gitfetch
。如果
git fetch
或 git fetch --all
不起作用,请尝试以下步骤
步骤:
vi .git/config
命令。[远程“原点”]
fetch = +refs/heads/:refs/remotes/origin/
您的最终代码将如下所示:
[remote "origin"]
url = [email protected]:fadiahac/seo-manager.git
fetch = +refs/heads/*:refs/remotes/origin/*
完成!! ✅👍