From 004cc8b3ece76a49e75fcbf0092bbcea7d13fb21 Mon Sep 17 00:00:00 2001 From: CandyAngel Date: Thu, 17 Jul 2014 11:25:15 +0000 Subject: [PATCH] --- ...et_git-annex_to_forget_a_commit__63__.mdwn | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 doc/forum/How_to_get_git-annex_to_forget_a_commit__63__.mdwn diff --git a/doc/forum/How_to_get_git-annex_to_forget_a_commit__63__.mdwn b/doc/forum/How_to_get_git-annex_to_forget_a_commit__63__.mdwn new file mode 100644 index 0000000000..d5aa71b448 --- /dev/null +++ b/doc/forum/How_to_get_git-annex_to_forget_a_commit__63__.mdwn @@ -0,0 +1,54 @@ +I've done a `git annex add` and `git commit` on my annex which included some files I don't want to add to the annex. I've tried to reverse it all out, but whenever I `git annex add` something, the unwanted files show up in the git-annex branch. + + git init forgetmenot + cd forgetmenot + git commit -m "create" --allow-empty + git annex init fmn + + echo 'foo' > foo + echo 'bar' > bar + + git annex add + git commit -m "add foo" + + git log --oneline --name-only + # 28634c0 add foo + # bar + # foo + # 4a87050 create + + git log --oneline --name-only git-annex + 74e6969 update + 41d/a26/SHA256E-s4--b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c.log + a70/4a5/SHA256E-s4--7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730.log + 95285ed update + uuid.log + 2135e07 branch created + +If you now try to get git-annex to forget by reverting *master* and *git-annex* and only adding/commiting *foo*, the master branch ends up correct, but git-annex magically remembers *bar*! + + git reset --hard HEAD^ + git branch -f git-annex git-annex^ + + echo 'foo' > foo + git annex add + git commit -m "add foo" + + git log --oneline --name-only + # 1b4889e add foo + # foo + # 4a87050 create + + git log --oneline --name-only git-annex + # 3d0b9bc update + # 41d/a26/SHA256E-s4--b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c.log + # a70/4a5/SHA256E-s4--7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730.log + # 2e17a19 update + # uuid.log + # 646776b branch created + +How is git-annex remembering this and how can I get it to completely forget? + +I have tried `git gc --aggressive --prune=all`, `git annex fsck --all` and `git annex drop unused` but somehow, git-annex is remembering bar existed. + +This is an exercise in micro-managing the git-annex branch a bit, but this situation does also cause git-annex to complain about the missing files on fsck (0 out of 2 copies) so it isn't just being a control freak! Honest! :)