Win 10 + Git - unable to create file - permission denied

耗尽温柔 提交于 2019-12-11 17:36:35

问题


This is really not a duplicate question. I tried few solutions like reset head^ , git checkout -- <file>,... but this does not solve my problem. The problem is that I can not revert the index.php file from "Changes not staged for commit" from git status because it throws me an error:

Unable to create file www/index.php: Permission denied during executing git "C:\Program Files\Git\bin\git.exe" -c core.quotepath=false checkout HEAD -- www/index.php

I dont understand what is wrong with that. I am an admnistrator, console runs as administrator.. I have all permissions to do this so what permission I need? What the hell is wrong? Help me please I am in the end.


回答1:


The problem with Git error - permission denied in this case has been caused by the incriminated file was open in other process. The solution was to shut down all the apps except one console, then run git checkout -- www/index.php and everything works as excepted without any trouble.




回答2:


When I did git checkout -- www/index.php this didn't work for me so My problem was happening because the antivirus had moved my file www/index.php to the virus trunk (baúl de virus)



来源:https://stackoverflow.com/questions/48782925/win-10-git-unable-to-create-file-permission-denied

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