4

I've just set up a repository on my server. I'd like to use it with a small group of developers. We want to have a central repository shared among us. We don't have experience with Git, but we want to learn. I have followed this instructions.

On the server:

$ git init --bare --shared foo.git
Initialized empty shared Git repository in /git/foo.git/
$ chgrp -R dev foo.git

On the clients:

$ git clone ssh://<my_server>/git/foo.git

Then each client will be able to make changes and push them to the server and pull changes from other users.

I want to ask you girls and guys if this configuration is correct. It seems so simple that I was doubting about its correctness???

ivantxo
  • 719
  • 5
  • 18
  • 36
  • 3
    Too simple to be correct, too cheap to be true... the painful lessons of years of living with bad software. – Kerrek SB Feb 18 '12 at 01:30
  • Are you having any actual problems with your setup? – Andrew Marshall Feb 18 '12 at 01:30
  • No problems at all! Just incredulous about this simplicity. Great! – ivantxo Feb 18 '12 at 01:45
  • It's kind of funny you ask the question and then try to run it... Worked for me out of the box (first time for me). @KerrekSB That's weird. If it's not simple, it's probably ridden with bugs and it's probably unmaintainable. If it's expensive, there's probably a much, much, much better open source alternative. That's my philosophy. And experience with reading complex code and using closed-source software. **shudder** – Irfy Feb 18 '12 at 01:45
  • @Andrew Marshall just one question. I have an already Java project I want to put it on Git. How do I make a repository from existing files? – ivantxo Feb 18 '12 at 01:49
  • @Irfy What are you talking about mate? Kerrek SB is pointing that Git is such a beautiful open source alternative??? – ivantxo Feb 18 '12 at 02:42
  • @ivan.freire Then I'm not following his line of thoughts... or irony :-) I understood the opposite from that comment. – Irfy Feb 18 '12 at 02:49
  • 1
    @Irfy: My comment was an allusion to the argument that is sometimes brought forward by "professional" organizations that something that's made by volunteers and given away for free cannot possibly be suitable for professional use, and the OP's suspicion reminded me of that - something that's so simple and "just works" cannot possibly be good, right? There must be a catch? And there are probably reasons why lots of people would expect a catch somewhere... – Kerrek SB Feb 18 '12 at 11:02

1 Answers1

4

Yep, that's about right. There's one more option you'd probably want to set: core.sharedRepository which tells Git that when it creates additional directories, it should chgrp them to that group.

There's a good writeup on how to set it at http://criticallog.thornet.net/2010/01/07/sharing-your-git-repository/

Jason Malinowski
  • 18,148
  • 1
  • 38
  • 55