So I ran into some more issues before getting my Git hosting (via Gitosis) all working.
The first hurdle was getting past an error thrown when attempting to do a `git clone` of the gitosis-admin repository. The error was being thrown by os.py (remember that gitosis-admin is python based). The error message looked like this:
Traceback (most recent call last):
File ”/usr/bin/gitosis-serve”, line 7, in ?
sys.exit( File ”/usr/lib/python2.4/site-packages/gitosis-0.2-py2.4.egg/gitosis/app.py”, line 24, in run return app.main()
File ”/usr/lib/python2.4/site-packages/gitosis-0.2-py2.4.egg/gitosis/app.py”, line 38, in main self.handle_args(parser, cfg, options, args)
File ”/usr/lib/python2.4/site-packages/gitosis-0.2-py2.4.egg/gitosis/serve.py”, line 205, in handle_args os.execvp(‘git-shell’, [‘git-shell’, ‘-c’, newcmd])
File ”/usr/lib/python2.4/os.py”, line 341, in execvp _execvpe(file, args) File ”/usr/lib/python2.4/os.py”, line 379, in _execvpe func(fullname, *argrest)
OSError: [Errno 2] No such file or directory
The root cause of this is that the executable `git-shell` is missing from your install directory (be /usr/bin or /usr/local/bin). I've done a install locally and all the 140-some executables were places in my install directory (/usr/bin).
Originally, I just copied `git-shell` into /usr/bin. That's hack-ish, what I ended up doing was creating a symlink to `git-shell` from where I have git (in my case, /opt/git-1.6.0, with a symlink to it named /opt/git).
So now we can do our clone of the repository:
`git clone git@YOUR_SERVER:gitosis-admin.git`
This appears in both tutorials I looked at [
urban puddle] [
scie.nti.st]
Now we want to create a new repository. That was my next hurdle; and you won't need to overcome it if you follow directions. Notably, the simple directions in either. Which is that you need to modify the gitosis.conf (which is Step 6 in the Urban Puddle tutorial and "Creating new repositories" in the scie.nti.st tutorial).
I attempted to simply do something like initialize a git repository, do some commits, add a remote (origin) to the server, and then push to that remote (origin).
If you have gone awry - like me - you'll run into the following error:
ERROR:gitosis.serve.main:Repository read access denied
fatal: The remote end hung up unexpectedly
If you add the following under [gitosis] in the gitosis.conf:
loglevel = DEBUG
You'll get some
helpful debug output.
lenards@deedee:~/devel/cs453/project$ git push origin master:refs/heads/master
DEBUG:gitosis.serve.main:Got command "git-receive-pack 'cs453-project.git'"
DEBUG:gitosis.access.haveAccess:Access check for 'lenards@deedee' as 'writable' on 'cs453-project.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'cs453-project.git', new value 'cs453-project'
DEBUG:gitosis.group.getMembership:found 'lenards@deedee' in 'gitosis-admin'
DEBUG:gitosis.group.getMembership:found 'lenards@deedee' in 'cs453-project'
DEBUG:gitosis.access.haveAccess:Access check for 'lenards@deedee' as 'writeable' on 'cs453-project.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'cs453-project.git', new value 'cs453-project'
DEBUG:gitosis.group.getMembership:found 'lenards@deedee' in 'gitosis-admin'
DEBUG:gitosis.group.getMembership:found 'lenards@deedee' in 'cs453-project'
DEBUG:gitosis.access.haveAccess:Access check for 'lenards@deedee' as 'readonly' on 'cs453-project.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'cs453-project.git', new value 'cs453-project'
DEBUG:gitosis.group.getMembership:found 'lenards@deedee' in 'gitosis-admin'
DEBUG:gitosis.group.getMembership:found 'lenards@deedee' in 'cs453-project'
ERROR:gitosis.serve.main:Repository read access denied
fatal: The remote end hung up unexpectedly
I missed the step in the directions about adding a new group to the gitosis.conf, which is why when doing your `git push origin master:refs/heads/master` it complains about not have readonly access. There is *no* group to access, so you don't have writable or readonly access.
After doing Step 6 from Urban Puddle tutorial - I was able to push my new repository for my compiler project.
I hope this helps someone.
Andy