Dear all,
I had (snif!) and indirect repo with 2.7 of pdf files with filenames were manually added by me with author and title, and took years of work. I had them in a git annex repo from quite some time.
Now I'm trying to sync them to an usb drive. Main repo lives in an ubuntu box with ext4 filesystem. I failed many times to do this, both on fat and exfat external drives (direct).
As I was failing, I tried to to a test on the same local filesystem. So I have my main repo in /home/juan/papers and the other in /tmp/papers.
While trying to sync them using the assistant, i noticed that most of the folders and symlinks from the main repo just dissapeared.
I still have them in .git/annex/objects but I don't know how to recover the links.
I must say I'm an everyday git user, and big fan of git-annex but I'm trying to use it for six months without luck. I think I will quit after recovering the data, if possible.
EDIT 1
After digging around a bit, I found that I had the keys, and could find out the original filename, for example:
git log --stat -S 1279
commit a6362df13d728037875320a457182acb073d08ea
Author: Juan Cardelino <x@gmail.com>
Date: Fri Nov 21 11:25:31 2014 -0200
2013_august/feature_matching_by_searching_maximum_clique_on_high_order_association.pdf | 1 +
LevelSets/fedkiw/stanford2002-06.pdf | 1 +
new/nfa/00106994.pdf | 1 +
3 files changed, 3 insertions(+)
How can I recover them?
EDIT 2
Seems that I overwritten my repo with a new repo. Because git log only shows 4 entries from today. Is it possible that the webapp has made that?
Well, git-annex just uses a regular git repo. It should not be possible to fully lose data. I suggest you run
git log --stat
and see if a commit deleted all your files. If so, you can revert that commit.If the git log really is only 4 commits deep, perhaps you got some other branch checked out somehow. Run
git reflog
to see the history of what branches have been checked out before, and you can usegit checkout
to go back to one of those past checkouts.Or, failing all that, you showed a commit a6362df13d728037875320a457182acb073d08ea which had one of your files, so
git checkout a6362df13d728037875320a457182acb073d08ea
will check out the tree as it appeared at the time of that commit.This is all git 101. AFAICS, you have not lost any data, and need to become more familiar with the basics of git.
I'm not new to git, and I perfectly know how to revert commits, however, I was confused about how git annex and git play together. In particular I tried to use it as a black box with the assistant and that was a bad idea. After adding the usb drive as remote with the assitant, all symlinks got deleted. However, doing a checkout to the commit that messed up everything I got thing back to normal. Sadly, your message arrived a couple of hours late, I could have saved me a lot of time. Thanks for taking the time to answer. Sorry for the previous rant. Best regards, Juan
I'm glad you were able to solve it!
Now that you know what the bad commit is, can you tell me what it looks like? The assistant should not be committing deletions of all files, unless all files actually were deleted...