I removed some archived directories perhaps foolishly with rm -rf
. How do I find the files that I've had deleted?
I also have an issue where by I want one command to sync between two hardrives and github. Or do I have to: git-annex move --to {foo,bar}; git-annex drop; git-annex sync
? Basically I want copies everywhere except on my laptop (X1C3).
I also expected my git dir to be much smaller than 1.4GB after dropping everything. Thanks!
Is your titular question a git-annex question, or a generic git question? Because I think the answer would be the same in either case. Ie,
git log
orgit status
will tell you what changes you've made to the work tree.If you've deleted files from your git working tree with rm -rf, then their content is still stored in the .git directory. This is also true when using git-annex (unless you're using direct mode).
The size of your .git directory might be a clue: If you've deleted files from the working tree, you may not have dropped their content from git annex. You can use
git annex unused
to find and clean up such file contents.This is a git-annex question. I want to find files that are not in my working tree but are on the backups on my two USB hard drives.
I see in this commit the images that I deleted: https://github.com/kaihendry/uploadme/commit/c53dbdd9bd7879d68635a2adc81a7bc59a84c5ea
How can I simply just get a listing of where the copies are?
For example I deleted IMG_4110.JPG.
But when I run:
I am pretty confident I have a copy of this on my external USB drives.
Also tried another file:
So I am still in the dark how to see how git-annex tracks deleted files across my remotes.
Have you tried checking out a commit which it was present in and then using whereis?
Not sure if you can do:
But if not, may be worth a feature request!
Yeah, you need to
git checkout
a tree from before you deleted the files, and then you'll be able to usegit annex whereis
in there on the deleted files. This will tell you where the files are currently located (not some historical data).git annex whereis --key
is indeed an alternative approach, if you know the key corresponding to the deleted file. You can see the keys in the git diff, if you know where to look.internals will let you understand how this all really works.
How do I undelete in my case then? I.e. not
git checkout
to find where they are.git revert c53dbdd9bd7879d68635a2adc81a7bc59a84c5ea
Assuming I make no effort to undelete or recover the files:
The (deleted) files I have copies of on my other two hard drives. Do they detect I've deleted the files and just clean up? How does that process work?