error: git checkout-index: unable to create file &

2019-05-23 14:52发布

When I try and pull from github I get a strange error. Can I bypass this or force it? I have used sudo before which I suspect would work however this caused other problems.

2条回答
Summer. ? 凉城
2楼-- · 2019-05-23 15:07

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.

查看更多
甜甜的少女心
3楼-- · 2019-05-23 15:21

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.

查看更多
登录 后发表回答