I am using git-annex to store the output of a build process that produces large binary files (~1GB). These files are built on a number of workers which then commit the files to a central server (git annex add && copy to origin)
I am trying to delete some of the older builds but have been unable to see any disk space be freed on the server (Disk usage is identical before and after the delete).
df -h
mcchicken-srv://repo 284G 114G 157G 43% /srv/repo
To delete the files I have performed the following:
- git clone
- git annex drop <1gb_file>
- git rm <1gb_file>
- git commit
- git annex sync
- [log into server]
- git annex sync
- git annex unused
- git annex dropunused
I have also tried other variations of the above technique that I have found online, but to no avail.
In all cases the files appear to not be in the repo when a clone is performed, However the disk usage on the server never decreases.
How would I delete the older builds in a manner that will free up disk space?
git annex drop
removes the file's content from the local repository. It does not affect other repositories, such as in your case the server. You could usegit annex drop --from origin
to remove the file from the origin repository.If
git annex unused
is not listing the deleted file as unused, there must be some git tag or branch that still refers to it.Also,
git annex dropunused
won't remove the last copy of a file unless you pass--force
A remote has 200MB of file contents in .git/annex.
A local repo issues a
git annex drop --from=myremote
.The remote .git/annex still has 200MB of file contents.
Sometimes it works. I'm guessing it has to do with the order of commands issued.
git annex drop can only drop files that the local repository knows about. Perhaps you forgot to update your local repo (eg with
git annex sync
) so it didn't know about the files in the remote and so couldn't drop them.Of course, git annex drop also will refuse to drop a file from a repository if that not preserve the required number of copies of the file. It will tell you if this is the case.
You need to post more details. I can assure you that git annex drop drops content from a repository.
I notice you also filed the bug report ?Unable to take transfer lock, where you said something about having copied the repository over SMB using
cp
and some kind of OSX copy and paste.So, if you did that, it seems likely that you have 2 git repositories with the same annex.uuid setting. In fact this is confirmed by another bug report you filed.
Since git-annex expects each repository to have a unique annex.uuid, this is going to confuse it badly. Don't do that. Use
git clone
to make a clone of a git repository.