2

Ages ago (months, anyway) I initialized git-annex on a repository for reasons that now escape me. I thought I managed to get rid of it, but today I discovered that it is still there and any new directories in the repository are "annexed" -- if I create a new file anywhere in the repo, I can edit it once and then once I save, it is stored as a git-annex object:

index.html -> ../.git/annex/objects/z3/gQ/SHA256E-s17--a58d9605c9c692e1df6adbed7e3e5bd7655345326d0297b55fd1faa13ae16fbb.html/SHA256E-s17--a58d9605c9c692e1df6adbed7e3e5bd7655345326d0297b55fd1faa13ae16fbb.html

I read the instructions at Remove git-annex repository from file tree and tried git annex uninit which got me this:

amanda@mona:talks$ git annex uninit
unannex 2018/test/Untitled Document ok
unannex 2018/test/index.html ok
unannex test/index.html ok
git-annex: Not fully uninitialized
Some annexed data is still left in .git/annex/objects/
This may include deleted files, or old versions of modified files.

If you don't care about preserving the data, just delete the
directory.

Or, you can move it to another location, in case it turns out
something in there is important.

Or, you can run `git annex unused` followed by `git annex dropunused`
to remove data that is not used by any tag or branch, which might
take care of all the data.

Then run `git annex uninit` again to finish.

So I deleted .git/annex and ran git annex uninit again. Tried to create a new file and ... it's a git annex object. I feel like I'm being haunted by a swamp thing. How on earth to I make it die?

I tried completely removing git-annex in Synaptic, and still, a new file is immediately transformed into an object in .git/annex/

Amanda
  • 12,099
  • 17
  • 63
  • 91
  • Wow yeah, me too. Really want to like git annex and will probably persevere but this driving me crazy (spent a whole day on it now). I even created new directory/files in the repo, copied the contents across, and then the new fiels get annexed too! I have run `git annex uninit` and ensured there are no dangling hooks but still it won't die – Tom Close Mar 12 '20 at 01:18

3 Answers3

1

After running git annex unannex a few times (which looked like it was going to fix the problem), manually deleting the hooks and recreating new files and copying and pasting the contents, I eventually fixed it for me by just cloning the repository and replacing the git annex links with real files.

Tom Close
  • 544
  • 6
  • 12
0

Double-check if you have any hook in your current Git repo

cd /path/to/my/repo/.git/hooks

Check also if git itself is a wrapper script.

Look for the git-annex (which git-annex)executable and remove it

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

If you want to get rid of git-annex from a Git repository, you can just use git clone to create a new replica of the original repository.

The newly cloned Git repository has nothing to do with git-annex. Yet it has, as a Git repository, everything that the old repository has. So you can work on the new repository and forget about git-annex.

Before cloning, make sure all changes in the original repository are committed (i.e.: the working directory is clean).

Zhi Zhu
  • 49
  • 1
  • 6