javatechnology javatechnology - 3 months ago 27
Git Question

cannot unlink `objects/pack/pack-23879505c4ebc19266f28b149fd52e0aa1e3889a.idx': Permission denied

I am really exhausted in deleting below file although I run code in administrator mode. Not sure what is blocking it deleting it. Please help me. Even I tried to delete file from windows CMD but no success.

user@USER-PC /D/Projects/Authorized.net/11/authorize.net/one/.git
$ rm -rf *
rm: cannot unlink `objects/pack/pack-23879505c4ebc19266f28b149fd52e0aa1e3889a.idx': Permission denied
rm: cannot remove directory `objects/pack': Directory not empty
rm: cannot remove directory `objects': Directory not empty


Here is the list from directory:

user@USER-PC /D/Projects/Authorized.net/11/authorize.net/one/.git
$ ls -lart
total 10
drwxr-xr-x 1 prateek Administ 12288 Apr 19 00:32 objects
drwxr-xr-x 1 prateek Administ 4096 Apr 19 00:32 .
drwxr-xr-x 1 prateek Administ 4096 Apr 19 00:58 ..


I'm trying to delete local files from present
GIT
.

Answer

you need to give full permission to that file and then you will be able to delete it.

user@USER-PC /D/Projects/Authorized.net/11/authorize.net/one/.git
$ chmod 777 .git/

then apply remove command

$ rm -rf .git/

then it will be get removed from machine.