Let's say you want to distribute some big files to the whole world. You can of course, just drop them onto a website. But perhaps you'd like to use git-annex to manage those files. And as an added bonus, why not let anyone in the world clone your site and use git-annex get!

My site like this is downloads.kitenet.net. Here's how I set it up. --Joey

  1. Set up a web site. I used Apache, and configured it to follow symlinks. Options FollowSymLinks
  2. Put some files on the website. Make sure it works.
  3. git init; git annex init
  4. We want users to be able to clone the git repository over http, because git-annex can download files from it over http as well. For this to work, git update-server-info needs to get run after commits. The git post-update hook will take care of this, you just need to enable the hook. chmod +x .git/hooks/post-update
  5. git annex add; git commit -m added
  6. Make sure users can still download files from the site directly.
  7. Instruct advanced users to clone a http url that ends with the "/.git/" directory. For example, for downloads.kitenet.net, the clone url is https://downloads.kitenet.net/.git/
  8. Set up a git post-receive hook that runs git annex merge, and the repository's working tree will automatically be updated when you run git annex sync in a clone that can push to the repository.
    (Needs git-annex version 4.20130703 or newer; older versions can use git annex sync in the post-receive hook instead.)

When users clone over http, and run git-annex, it will automatically learn all about your repository and be able to download files right out of it, also using http.

Hi,

would it be possible to do this whith the contents of a public repository-group (a non-bare public repository)?

You can choose which files get stored in the public repository, and are thus accessible to the public. However, note that since the git repository is published, anyone could clone it and see all the names and hashes of your files, even if you've not pushed the file contents to the public repository.

Currently the way the "public" repository group works only makes it be usable with special remotes. This is because it uses a preferreddir setting in the special remote configuration.

Comment by http://joeyh.name/ Tue Jul 16 17:54:28 2013
Comments on this page are closed.