error: git checkout-index: unable to create file (Permission denied)

穿精又带淫゛_ 提交于 2019-12-06 13:31:50

I had this problem as well. I solved it by changing the ownership of the directories to the user I was trying to git pull with:

sudo chown -R anthony:anthony *

I ran that at the root of my git tracked directory to make sure all the files were owned by the correct user.

In my case it was having sublime text open with the git controlled directory added as a folder in the sublime project. After closing sublime I was able to switch branches without a problem.

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