Gitosis and read-only Git repositories
When I’ve started working with Git, besides using the quick how-to guides from the official site, I’ve also wanted to read a more detailed book about how this distributed VCS tool should be used in order to benefit from all of its functionalities. One of these books is Pro Git by Scott Chacon, from Apress. The e-book version I own dates from September 2009, although its content is freely available (with the proper updates and revisions) here.
One of the most interesting tools for Git is Gitosis, an application which allows you to automate repository management and to have your own hosted repo on one of your servers (click here to install it on Ubuntu; a good start-up guide can be found here). In my case, this server is Geordi. While I do use GitHub too, Gitosis manages my non-public projects. Not only that Gitosis creates your repositories on the server once you need them, but it also handles user access allowing to have multiple users (commiters or followers) with read/write rights depending on the project.
Today I wanted to allow Tudor to be able to clone one of my private repositories but in the same time I didn’t want to give him push permissions. The edition of Pro Git I have listed this configuration for the previous job:
[group groupName] writable = repoName members = user1 user 2 user3 [group groupName-readonly] readable = repoName members = user 4
With this set-up, every time when Tudor tried to clone my repository, Gitosis would respond with:
ERROR:gitosis.serve.main:Repository read access denied fatal: The remote end hung up unexpectedly
The problem was on the highlighted line. It seems that the correct keyword for setting read-only user access is nothing other than readonly. With that put up in place everything worked as it should from the beginning. Although the online book now uses the correct keyword, you might still find PDF files of the book with the wrong example in which case you now have a solution.
Keep on pushing!
You might also like:
7 Comments
Leave a comment
Recent Posts
Projects that I support
Recent Comments
nope said:
yeah that was my first thought too, but: mount: warning: seems to be mounted read-write. too bad, would have been just perfect. more»Klaus Deiss said:
Dear Radu, I tried it on Ubuntu 10.0.4.2 and 10.0.4.3 with different kernel versions (amd64 server 2.6.32 kernel). No... more»scompo said:
Nope.. Now it’s not working again.. This printer it’s a real pain in the butt.. The other hp printer I had... more»Dmitrij said:
Thank you Peter and Patrice. Could you please post the updated script? more»hd_flash_pains said:
didn’t work for me more»








I still don’t get why you don’t use Github like everybody else…
Because there are some lines of code that I really want to be private… I am using it though for my open-source efforts (VMware scripts, Canon printer drivers for 64-bit Ubuntu and several other scripts and programs).
R we supposed to do it like everybody else?
But you can have private repos. It’s 12 bucks…don’t be cheap
Besides not having an UPS, I don’t see any other disadvantage of using my own private server for hosting my private Git repositories. Yeah, GitHub provides a shiny web interface and some graphs, but it’s nothing more than a wrap around git.
I really enjoy using GitHub for my open-source stuff but I don’t (yet) feel the need of buying features that I already have for free.
Why haven’t you listed the correct file ? eventually doing something like
readablereadonlyIt would have been easier to understand
I am pretty sure anyone can read the whole post and figure out the correct setting. The point is to also see what’s wrong.