spine-generic / data-multi-subject

Multi-subject data for the Spine Generic project
Creative Commons Attribution 4.0 International
22 stars 15 forks source link

Cannot delete git-annex directory #25

Open jcohenadad opened 4 years ago

jcohenadad commented 4 years ago

Getting this:

[jcohen@gra-login3 ~]$ rm -rf data-multi-subject/
rm: cannot remove 'data-multi-subject/.git/annex/objects/Mm/XM/SHA256E-s18582870--fc52f3193bbfd019e72467c15cac7a32259e52e86a251e654501143b917f5ffc.nii.gz/SHA256E-s18582870--fc52f3193bbfd019e72467c15cac7a32259e52e86a251e654501143b917f5ffc.nii.gz': Permission denied

I remember @kousu had a trick, but i forgot what it was. We should document it.

kousu commented 3 years ago

Just sudo it.

git-annex is extra-paranoid even more than regular git, and sets all the files and even their containing folders read-only. -f can't override that. You could also do chown -R +w data-multi-subject/.git/annex; rm -r data-multi-subject.

I'll put this on my list of complaints about git-annex.

jcohenadad commented 3 years ago

Just sudo it.

oopsi 😬

[jcohen@gra-login2 ~]$ sudo rm -rf data-multi-subject

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for jcohen: 
jcohen is not in the sudoers file.  This incident will be reported.
jcohenadad commented 3 years ago

You could also do chown -R +w data-multi-subject/.git/annex; rm -r data-multi-subject.

[jcohen@gra-login2 ~]$ chown -R +w data-multi-subject/.git/annex
chown: invalid user: ‘+w’
kousu commented 3 years ago

This is what I get for answering threads late at night! Try this:

chmod -R +w data-multi-subject/.git/annex; rm -r data-multi-subject