DEV Community

Discussion on: Deleting Git Repo. Blocked by SymLinks

Collapse
 
emgodev profile image
Michael • Edited
$ rm -r .Trash-1003
rm: cannot remove '.Trash-1003/files/.git/objects/8f/*/*': Too many levels of symbolic links
rm: cannot remove '.Trash-1003/files/.git/objects/8f/*/.. (/8f': Too many levels of symbolic links
rm: cannot remove '.Trash-1003/files/.git/objects/8f/*/.. (': Directory not empty
rm: cannot remove '.Trash-1003/files/.git/objects/8f/.. (/8f': Too many levels of symbolic links
rm: cannot remove '.Trash-1003/files/.git/objects/8f/.. (': Directory not empty
$ alias d
alias d='rm -vr --one-file-system --preserve-root '
$ alias noask
alias noask='-f '
$ d noask .Trash-1003/
rm: cannot remove '.Trash-1003/files/.git/objects/8f/*/*': Too many levels of symbolic links
rm: cannot remove '.Trash-1003/files/.git/objects/8f/*/.. (/8f': Too many levels of symbolic links
rm: cannot remove '.Trash-1003/files/.git/objects/8f/.. (/8f': Too many levels of symbolic links
Collapse
 
dechamp profile image
DeChamp

‘rm -rf .git’ will tell it to force delete the symlink and not follow.

Thread Thread
 
emgodev profile image
Michael

Worked, I had to move it off the external drive though. I had to not use my aliases though, which was weird. It would give the error when I tried to move it also.