为什么git附件不死?

Why won't git annex die?

很久以前(几个月,总之)我在一个存储库上初始化了 git-annex,原因我现在想不起来了。我以为我设法摆脱了它,但今天我发现它仍然存在并且存储库中的任何新目录都是 "annexed"——如果我在存储库中的任何地方创建一个新文件,我可以编辑一次然后一旦我保存,它就会存储为 git-annex 对象:

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

我在 Remove git-annex repository from file tree 阅读了说明并尝试了 git annex uninit 结果是:

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.

所以我又删除了.git/annex和运行git annex uninit。试图创建一个新文件......它是一个 git 附件对象。我觉得我被沼泽的东西困扰了。我到底要怎么让它死?

我尝试完全删除 Synaptic 中的 git-annex,但仍然会立即将新文件 运行 转换为 .git/annex/

中的对象

仔细检查您当前的 Git 存储库中是否有任何钩子

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

还要检查 git 本身是否是包装脚本。

查找 git-annex (which git-annex) 可执行文件并将其删除

经过运行git annex unannex几次(看起来是要解决问题),手动删除钩子并重新创建新文件并复制和粘贴内容,我最终解决了对我来说,只需克隆存储库并将 git 附件链接替换为真实文件即可。