Cannot open FETCH_HEAD after renaming a branch

早过忘川 提交于 2019-12-08 14:14:19

In fact, it seems that this problem is (potentially) due to the combination of various factors:

  1. I have actually renamed a branch (but that doesn't seem to be the major causek)
  2. I have also updated username and email address (this can support the analysis that I have performed various operations as some other user)
  3. Some branches was unable to be fetched certainly because of a known bug of SourceTree (which have suddenly stopped tracking of some remote branches)

As using chown command doesn't seem to be effective, I have finally resolved my issue using the following process:

  1. Removing the denied file using the command rm -f .git/FETCH_HEAD (as described in this answer)
  2. Reconnecting the untracked branches using the command git branch -u (as described in this comment)

After that, I was able to fetch all the remote branches, and now, all is correctly synchronized with my local repository.

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