I am trying to create a git repository on a shared hosting account that can be accessed both with me and with a friend. I successfully did this with the Subversion repository by adding this line to ~ / .ssh / authorized_keys:
command="/usr/bin/svnserve -t -r /path/to/svn/repo \
--tunnel-user=myfriend",no-port-forwarding,no-agent-forwarding,\
no-X11-forwarding,no-pty [ssh key]
So far, I have learned that git -shell is the git equivalent of svnserve, but there seems to be no equivalent of the -r option to restrict access to a specific path. This is problematic because there are other git repositories that I don't want my friend to have access to.
I read briefly about gitosis, which seems to be able to do what I want, but I want to see if there is a simpler solution before trying to configure another piece of software to fulfill this specific requirement. Thanks in advance!
Edit: I found this article that provides a script for this:
http://eagain.net/blog/2007/03/22/howto-host-git.html
But in fact, it was written by the same guy who later wrote gitosis and was marked as obsolete. It also seems that gitosis will not be possible in my situation, because this requires the creation of a special UNIX user, which I cannot do with a shared hosting account. I would like to be proved wrong if I misunderstood all this, however!
source
share