2011-03-03 19:44:01 +00:00
|
|
|
Due to popular demand, git-annex can now be used with bare repositories.
|
|
|
|
|
2011-03-04 01:56:03 +00:00
|
|
|
So, for example, you can stash a file away in the origin:
|
|
|
|
`git annex move mybigfile --to origin`
|
2011-03-03 19:59:16 +00:00
|
|
|
|
|
|
|
Of course, for that to work, the bare repository has to be on a system with
|
2011-03-03 20:40:55 +00:00
|
|
|
[[git-annex-shell]] installed. If "origin" is on GitWeb, you still can't
|
|
|
|
use git-annex to store stuff there.
|
2011-03-03 19:44:01 +00:00
|
|
|
|
2011-10-29 23:16:45 +00:00
|
|
|
It took a while, but bare repositories are now supported exactly as well
|
|
|
|
as non-bare repositories. Except for these caveats:
|
2011-03-03 19:44:01 +00:00
|
|
|
|
2011-10-29 23:16:45 +00:00
|
|
|
* `git annex fsck` works in a bare repository, but does not display
|
|
|
|
warnings about insufficient
|
|
|
|
[[copies]]. To get those warnings, just run it in one of the non-bare
|
|
|
|
checkouts.
|
|
|
|
* `git annex unused` in a bare repository only knows about keys used in
|
|
|
|
branches that have been pushed to the bare repository. So use it with care..
|
2011-10-29 23:30:48 +00:00
|
|
|
* Commands that need a work tree, like `git annex add` won't work in a bare
|
|
|
|
repository, of course.
|
2016-07-20 17:39:13 +00:00
|
|
|
* However, you can run commands like `git annex copy`, `git annex get`, and
|
|
|
|
`git annex drop` in a bare repository. In a bare repository, these
|
|
|
|
behave as if the `--all` option were used, and so operate
|
|
|
|
on every single version of every single file that is present in the git
|
|
|
|
repository history. The `--branch` option can be used to make these
|
|
|
|
commands only operate on the files referenced by a specified branch.
|
|
|
|
For example: `git annex get --branch master`
|
2011-11-04 23:19:13 +00:00
|
|
|
|
|
|
|
***
|
|
|
|
|
|
|
|
Here is a quick example of how to set this up, using `origin` as the remote name, and assuming `~/annex` contains an annex:
|
|
|
|
|
|
|
|
On the server:
|
2012-10-22 17:36:54 +00:00
|
|
|
|
2012-10-22 17:34:33 +00:00
|
|
|
git init --bare bare-annex.git
|
2013-09-26 00:24:04 +00:00
|
|
|
cd bare-annex.git && git annex init origin
|
2011-11-04 23:19:13 +00:00
|
|
|
|
|
|
|
Now configure the remote and do the initial push:
|
|
|
|
|
|
|
|
cd ~/annex
|
2012-10-22 17:34:33 +00:00
|
|
|
git remote add origin example.com:bare-annex.git
|
2011-11-04 23:19:13 +00:00
|
|
|
git push origin master git-annex
|
|
|
|
|
2016-07-20 17:39:13 +00:00
|
|
|
Now `git annex info` should show the configured bare remote. If it does
|
|
|
|
not, you may have to pull from the remote first (older versions of
|
|
|
|
`git-annex`).
|
2011-11-04 23:19:13 +00:00
|
|
|
|
2016-07-20 17:39:13 +00:00
|
|
|
If you wish to configure git such that you can push/pull without arguments,
|
|
|
|
set the upstream branch:
|
2011-11-04 23:19:13 +00:00
|
|
|
|
|
|
|
git branch master --set-upstream origin/master
|
|
|
|
|
|
|
|
|