summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-10-17 14:16:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-10-17 14:16:05 -0400
commit9f30134300b2b119895389f73d413320dc897359 (patch)
treeed065aa3dd1897f260202d7e225566bf786414e3
parent617bdc740f76e0b5cb8d73a8b122cd2b3e6fe961 (diff)
new tip for gitolite and git-annex
-rw-r--r--doc/tips/using_gitolite_with_git-annex.mdwn71
1 files changed, 71 insertions, 0 deletions
diff --git a/doc/tips/using_gitolite_with_git-annex.mdwn b/doc/tips/using_gitolite_with_git-annex.mdwn
new file mode 100644
index 000000000..c4df42cae
--- /dev/null
+++ b/doc/tips/using_gitolite_with_git-annex.mdwn
@@ -0,0 +1,71 @@
+[Gitolite](https://github.com/sitaramc/gitolite) is a git repository
+manager. Here's how to add git-annex support to gitolite, so you can
+`git annex copy` files to a gitolite repository, and `git annex get`
+files from it.
+
+A nice feature of using gitolite with git-annex is that users can be given
+read-only access to a repository, and this allows them to `git annex get`
+file contents, but not change anything.
+
+First, you need new enough versions:
+
+* gitolite 2.2 is needed -- this version contains a git-annex-shell ADC
+ and supports "ua" ADCs.
+* git-annex 3.20111016 or newer needs to be installed on the gitolite
+ server. Don't install an older version, it wouldn't be secure!
+
+And here's how to set it up. The examples are for gitolite as installed
+on Debian with apt-get, but the changes described can be made to any
+gitolite installation, just with different paths.
+
+1. Set `$GL_ADC_PATH` in `.gitolite.rc`, if you have not already done so.
+
+ echo '$GL_ADC_PATH = "/usr/local/lib/gitolite/adc/;' >>~gitolite/.gitolite.rc
+
+2. Make the ADC directory, and a "ua" subdirectory.
+
+ mkdir -p /usr/local/lib/gitolite/adc/ua
+
+3. Install the git-annex-shell ADC into the "ua" subdirectory and make it
+ executable.
+
+ cd /usr/local/lib/gitolite/adc/ua/
+ wget https://raw.github.com/sitaramc/gitolite/pu/contrib/adc/git-annex-shell
+ chmod +x git-annex-shell
+
+4. Now all gitolite repositories can be used with git-annex just as any
+ ssh remote normally would be used. For example:
+
+<pre>
+# git clone gitolite@localhost:testing
+Cloning into testing...
+Receiving objects: 100% (18/18), done.
+# cd testing
+# >git annex init
+init ok
+# cp /etc/passwd my-cool-big-file
+# git annex add my-cool-big-file
+add my-cool-big-file ok
+(Recording state in git...)
+# git commit -m added
+[master d36c8b4] added
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+ create mode 120000 my-cool-big-file
+# git push --all
+Counting objects: 17, done.
+Delta compression using up to 2 threads.
+Compressing objects: 100% (12/12), done.
+Writing objects: 100% (14/14), 1.39 KiB, done.
+Total 14 (delta 0), reused 1 (delta 0)
+To gitolite@localhost:testing
+ c552a38..db4653e git-annex -> git-annex
+ 29cd204..d36c8b4 master -> master
+# git annex copy --to origin
+copy my-cool-big-file (checking origin...) (to origin...)
+WORM-s2502-m1318875140--my-cool-big-file
+ 2502 100% 0.00kB/s 0:00:00 (xfer#1, to-check=0/1)
+
+sent 2606 bytes received 31 bytes 1758.00 bytes/sec
+total size is 2502 speedup is 0.95
+ok
+</pre>