linux - Remove git-annex repository from file tree -
i tried installing git-annex yesterday backup files. ran git annex add .
in root of repository tree , git commit
. far fine.
what didn't know git-annex doing turning entire file tree whole bunch of symlinks. every single file in whole tree symlinked .git/annex/objects
! messing application depends on files not being symlinks.
my question is, how rid of git-annex , restore file system original state? normal git repo rm -r .git
, i'm afraid won't job in git-annex. in advance.
okay, stumbled upon docs git-annex, , give 2 commands achieve wanted do:
unannex [path ...]
use undo accidental git annex add command. can use git annex unannex move content out of annex @ point, if you've committed it. not command should use if intentionally annexed file , don't want contents more. in case should use git annex drop instead, , can git rm file.
uninit
use stop using git annex. unannex every file in repository, , remove of git-annex's other data, leaving git repository plus annexed files.
i started running git annex uninit
, god slow. took 5 minutes "unannex" single file. filesystem tree 200,000 files, unacceptable.
what ended doing surprisingly simple , worked well. used cp -rl
flags automatically duplicate contents of file tree , reverse symlinks in duplicate copy. , blazing fast: around 30 seconds entire file tree. problem file permissions not retained original state, needed run chmod
, chcon
commands fix permissions.
this second method worked me because there no other symlinks in schema. if have symlinks in schema beyond created git-annex, little shortcut isn't right choice you, , should consider sticking git annex uninit
.
Comments
Post a Comment