Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So, recently Windows has decided to do some trolling on me and make it impossible to commit to my git repository

It gives me this error in git (in Cygwin):

$ git commit -a
error: insufficient permission for adding an object to repository database .git/objects

error: NVG510Fixer/NVG510Fixer/Resources/layout/WarningConfirmation.axml: failed to insert into database
error: unable to index file NVG510Fixer/NVG510Fixer/Resources/layout/WarningConfirmation.axml
fatal: updating files failed

Well... but then I go to the NVG510Fixer folder and recursively take ownership of everything in there and make sure that Everyone has full control. This seems to work, but it doesn't make the error go away.. So, I decide to go to .git and right click on properties and take ownership(recursively) from there. At this point, it gets even more weird:

enter image description here

What the hell is Windows doing?! I'm an Administrator. This computer isn't even joined to a domain. How can I not access files that I could access just a few minutes ago!?

share|improve this question
    
Are you sure that the Cygwin prompt is opened with Admin access ? –  Lamb Aug 8 '13 at 4:25

2 Answers 2

Use the takeown command from a administrative command line. It is possible to remove Full Access permissions to the Administrators group, if that happens the GUI version can't change permissions but the command-line command can still do it.

takeown /f C:\dev\nvg510controls\.git /r /d Y

if you want to be extra fancy you can set the permissions via the command line too

icacls C:\dev\nvg510controls\.git /t /grant Everyone:(F)
share|improve this answer
    
Tried this for a similar situation and "Error:Access is denied" –  John Aug 4 at 7:33
    
@John then you where not running it from a administrative command line. You need to make sure you choose "Run As Administrator" when you opened the command prompt. –  Scott Chamberlain Aug 4 at 13:00

Try changing the owner back to someone else and back to yourself recursively. That generally does the trick for me. I think this might be because you don't have access to the sub folders and files, but only the .git folder. Change the owner and select all subfolders option. Then change the permissions with the same tree option enabled see if it works

share|improve this answer
    
This likely should have been a comment since you didn't explain HOW to change the owner to another user. –  Ramhound Aug 8 '13 at 12:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.