git fetch keeps failing

时光怂恿深爱的人放手 提交于 2019-12-25 09:28:37

问题


I created a branch on Ms TFS and I tried to pull it on to my local machine with the code:

git fetch

This is the result of the 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)

Then I searched it on Google and StackOverflow, and they told me to do:

git gc --prune=now

And also:

git remote prune origin

Then I did again:

git fetch 

So I can work on that branch but it gives back the result/error as above.

Someone has some advice?


回答1:


  1. Make sure the user run the git fetch has the write permission to your local repository.
  2. Please check if there is a file called "192RestService" under refs/remotes/origin/tryYourself/
  3. Try to remove the file "192RestService", then check the gitfetch again.


来源:https://stackoverflow.com/questions/44819325/git-fetch-keeps-failing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!