tags:

views:

4837

answers:

12

Hi

Let's say we have a small team, 1-5 persons. What type of "git setup" would you use?

Would you use gitweb and apache so you could run over http? Or would you use the user-accounts and ssh in some way?

Today I'm familiar to use SubVersion thou apache (http), but I'm not sure it is right to setup to use git the same way...

Thanks Johan


Update: It feels like if we combine the answer that Dietrich Epp and the one hallidave gave I could get a quick and good solution.

A common dir in the servers filesystem where some can write, and that dir is also exposed with apache. That way everybody can always get the latest, but only trusted people can write to it...


Update: If you don't need to have the code "in the house", github.com does have a very nice service (that work very nice).

And their idea that the service is free if you write free code, and if your code is not free you pay for it seems like a good idea (see https://github.com/account/billing).

+8  A: 

I would actually use a GitHub account, either free or one of the small paid plans depending on your needs. It's not truly "decentralized," but GitHub has some great advantages and in my opinion there's nothing wrong with the model of pushing to an origin repo.

Marc Charbonneau
+1  A: 

I use GitHub for all my OSS projects and I host my own git server on a dreamhost box for private stuff. The private stuff I just serve up via gitweb+apache

cpjolicoeur
+6  A: 

Git is even easier to use with Apache than Subversion. All you need to do is set up a public repository in the server (use "public repository" as search term to find more info). The server needs to have Git, but Git isn't acting as a server, it's just managing the files and Apache is serving them out as plain old data.

A typical workflow might be this:

Sally is in charge of the project. She has her own repository on her workstation and has a public repository on the server. She has shell access to the server so she can push changes there.

Joe and Bill work with Sally. They pull changes from Sally's public repository, but they don't have permission to write to it. When they have something to give to Sally, they send her an email. Sally pulls Joe's changes from his public repo, then pushes to her public repo. Bill then pulls from Sally's repo and he gets Joe's changes too.

In a sense, you've got centralization, because there's one person who's in charge of deciding what the authoritative version of your app is. You could also just give everyone shell access to your central repository, perhaps giving them limited shells that can only run git.

Dietrich Epp
But remember about running git-update-server-info, perhaps from hook
Jakub Narębski
+1  A: 

I use git on an Open Solaris host (Joyent) through ssh.

What that means is that the offsite repository is on that host; I do my work on my desktop machine, and then push to the offsite frequently enough that I do not risk losing stuff to a desktop crash.

It is straightforward with Joyent's administrator UI to add git logins.

Thomas L Holaday
+1  A: 

There is also a git plugin (http://trac-hacks.org/wiki/GitPlugin) for Trac (http://trac.edgewall.org/) but only browsing through your repository is possible.

piobyz
A: 

I use github for my projects, but for self-hosting, gitorious is rather nice.

Dustin
+5  A: 

I'd recommend Github. It's simple to use, has a very nice UI and makes collaboration trivial. If you are working on something open-source, the free accounts are more than adequate. If you need private repositories, you'd need the "Small plan", which is 12USD/month.

If you want to run your own git server, I would recommend gitosis, a tool to simplify the setup/configuration/authentication (although it's not difficult to do this manually)

One note, using git in a centralised "SVN-like" setup is perfectly okay. Just because git is "decentralised" doesn't mean you are not allowed a "main" repository..

Git being decentralised just gives you more flexibility, so it doesn't require a central server to function.

dbr
The best thing about gitosis is you don't need to give access to everyone to your build server.
Makis
+9  A: 

For a shared repository on your own server, the easiest setup is to just use ssh. Give each user an account on the server machine and set up a bare git repository in a directory that everyone has write permission for.

To clone the repository:

git clone user@server:/path/to/repo

If you don't want to create user accounts, you could also use Gitosis which allows you to administer access using public keys rather than full user accounts.

http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way

hallidave
+1. We're using SSH. It's simple, easy to setup and as safe as you can get.
Milan Babuškov
+1  A: 

We use ssh access to git at work. I like it because A) I am lazy and ssh is (generally) already set up and B) takes the access control away from a new service, like gitorious, and gives it to something that has been around for a long time and does a solid job of handling security.

If you want anon access, then git over ssh probably isn't the best solution.

docgnome
+1  A: 

I would recommend to use ssh+cgit. cgit makes it really easy to see the changes as they happen and you can even suscribe to the RSS feeds, you can do that with gitweb too, but cgit is so much faster. ssh is very easy to setup, secure and it's the preferred way to push in git.

felipec
+2  A: 

Cant believe no one has mentioned gitosis

http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way

Lamnk
A: 

We use unfuddle.com which does a very nice job with tickets, repositories etc. etc.

Frank M