Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to remove git repo on ubuntu guest

I am trying to remove whole git repository from my local machine, but git prohibits to delete several files.

I've tried:

  1. rm -r folder
  2. It asked me do I want to delete some write-protected files? I've asked y.
  3. Following message appeared:

    rm: cannot remove ‘.git/objects/08/fa4fcd8413b84a1605e1c4866cb2493daf4c4e’: Operation not permitted
    rm: cannot remove ‘.git/objects/96/de4fe9aa42239290cae341427649f2afbdab16’: Operation not permitted
    rm: cannot remove ‘.git/objects/fd/ed37600b5fe66e1a0d0e4355b387e56ca2638e’: Operation not permitted
    rm: cannot remove ‘.git/objects/pack/pack-cb277ab3b4a3510209a9784a76760e6281da5218.idx’: Operation not permitted
    rm: cannot remove ‘.git/objects/pack/pack-cb277ab3b4a3510209a9784a76760e6281da5218.pack’: Operation not permitted
    

The ls command showed that all local files were deleted. Then I tried sudo rm -r .git from that folder - same result.

Help me please delete that folder.

like image 907
Danny Ocean Avatar asked Apr 21 '14 23:04

Danny Ocean


1 Answers

  1. Close any git clients that might be running.

  2. Set the permissions to delete first:

    chmod -R 777 folder
    
  3. Try to force the deletion:

    rm -rf folder
    
like image 118
Phillip Ngan Avatar answered Sep 18 '22 14:09

Phillip Ngan