2

This is the very first time I have set up a git server, as a warning, and I don't administer much.

I finally got a team of mine to switch over to git. Setting it up was surprisingly easy with the proper guide, I set up a user git and put the keys of my teammates into the authorized_keys file.

But they want chosen people outside the team to have read-only access to the repo, for demo purposes and such. I wanted to make just users for them and link the repo, but apparently they wouldn't want these guests to have any access to the server.

So is there a way I can make users to have read-only access by user/password or something else that kind of restricts their access?

EDIT: Thanks for your input, it will surely take me a while to set those up and try what's best.

Lanbo
  • 15,118
  • 16
  • 70
  • 147

3 Answers3

2

We use gitolite to do just that. It's great.

sinelaw
  • 16,205
  • 3
  • 49
  • 80
  • Ok I tried for some time to get this running, but somehow fiddling with the ssh thingies gives me headaches. But Gitolite sounds as the best choice, as it allows users without server registration. – Lanbo Jul 28 '11 at 21:42
  • mbx - It's easy to manage, easy to migrate (like gitosis, the config is just a git repo itself), has decent documentation. Unlike gitolite it has permissions per branch. Unlike Gitorious it doesn't require many prerequisites. I used gitosis before and migrated to gitolite for a specific reason I can't remember...But now I'm happy I did because turns out I do need per-branch permissions. – sinelaw Aug 01 '11 at 05:55
2

Actually we use gitosis, for smaller environments it's quite ok. You can make repositories readonly for a group of users and writable for others. If you need more flexibility gitolite might be the right thing for you. If you're into ruby gitorious is an option as well.

For convenience I'd also suggest a web interface like gitweb, where you can limit the access via the web server.

See also this SO Question

Community
  • 1
  • 1
mbx
  • 6,292
  • 6
  • 58
  • 91
  • I have no complaints with gitosis, but haven't tried the other ones. – cmcginty Jul 28 '11 at 21:27
  • @Casey gitolite provides permissions per branch, which is AFAIK impossible with gitosis. We haven't needed that either, so were sticking with gitosis so far. – mbx Jul 28 '11 at 21:44
0

You can use the git daemon for readonly access. Its publicly clonable, but very restricted in that you can only clone.

http://progit.org/book/ch4-9.html <- explains more

In the past I have given people a certain window of time to access the repo before turning it off.

Buddy Lindsey
  • 3,560
  • 6
  • 30
  • 42