$ mkdir annex-test
$ cd annex-test/
$ git init
Initialized empty Git repository in /home/me/annex-test/.git/
$ git annex init
init (scanning for unlocked files...)
ok
(recording state in git...)
$ cat > .gitignore
*
$ cat > exampyle.txt
hello
$ git annex add --no-check-gitignore
add .gitignore (non-large file; adding content to git repository) ok
add exampyle.txt
ok
(recording state in git...)
$ git commit -m \"added\"
[master (root-commit) 2734615] added
2 files changed, 2 insertions(+)
create mode 100644 .gitignore
create mode 120000 exampyle.txt
$ ln -rs exampyle.txt what.foo
$ git status
On branch master
nothing to commit, working tree clean
$ git annex uninit
git-annex: what.foo points to annexed content, but is not checked into git.
Perhaps this was left behind by an interrupted git annex add?
Not continuing with uninit; either delete or git annex add the file and retry.
What should I do?
Honestly, I'm happy with git-annex so far, I'm just thinking that I need to re-init with annex.tune.objecthashlower=true
because my other computer is windows.
Thanks!
You forgot to add your (gitignore'd)
what.foo
to git. Anothergit annex add --no-check-gitignore;git commit -m "add link"
will make the subsequentgit annex uninit
work properly. This is also what the error message says, btw.But there's another problem underneath: Why is
what.foo
an annex-style symlink anyway? It should just point toexample.txt
, right?For some reason
ln
dereferencesexample.txt
before linking, resulting inwhat.foo
pointing to the same asexample.txt
-- not just toexample.txt
-- causingwhat.foo
to look exactly like an annex link. I thought-n
could fix this, but it would operate on the targetwhat.foo
, not the sourceexample.txt
🤦. I couldn't makeln
do this properly, except for renaming/removingexample.txt
, thenln -rsf example.txt what.foo
, then restoringexample.txt
. Not viable. A better solution iscp -s example.txt what.foo
. That will makewhat.foo
point properly to justexample.txt
and not its target.BTW you can still just
git add
things like normal non-annex symlinks likewhat.foo
, no need forgit annex add
here.Also, joey prefers to have bug reports/questions and the like in either todo, bugs or forum, because it's clear those are the places to look through for issues. Comments below random manpages are quick to be forgotten about. 🙂
Thank you for the illuminating comment!
You’re right! I thought I only had a relative symlink pointing to the other symlink and not pointing into .git/annex/objects. It turns out that this is true for most of my symlinks but, just like you pointed out, some of them were pointing into .git/annex and the right thing to do there is to
add
them.Also, thank you for pointing me towards todo/bugs/forum!