Git Hosting Solutions
By Ryan Florence, published 2010-07-27
Part of the issue Git Your Act and Deployment Together.
There are a few ways to host git repositories, some make your life easier than others.
On your server
The current standard (as far as I can tell). We use this at work and it works out really well. It removes the need for everybody to have a user account on our git hosting server. Administration is all done through a git repository on your workstation, then you simply push like any other repository.
$ git clone git://eagain.net/gitosis.git
There’s a README inside the repository to explain how to install. If you run in to issues, google can sort of help, but not always :(
The new kid on the block. We plan to migrate to gitolite as soon as things slow down a bit. Nearly identical to gitosis, but more features; namely, you can prevent users from pushing to certain branches of a repository (stay off my master branch, off-shore dude!) and it actually has documentation.
Nothing is stopping you from just creating repositories on your server or some network computer and using them. The big draw back, though, is that you’ll be constantly fighting the OS over permissions and user accounts. But for a single developer, or even a team of 2 or 3, there’s absolutely nothing wrong with it.
After git is installed on your server, it’s quite simple:
$ ssh email@example.com $ mkdir ~/git $ mkdir ~/git/my_website.git $ cd ~/git/my_website.git $ git --bare init
Bare just means the repository has no working tree (no files) just the git objects. Typically you don’t push to anything but a bare repo. Now on your workstation:
$ git clone ssh://firstname.lastname@example.org/~/git/my_website.git $ cd my_website $ touch README $ git add . $ git commit -m 'first commit' $ git push origin master
Here are some other resources, please comment with other resources you’ve found helpful for your hosting provider:
Github is a great choice with tons of features (like pre-rolled post-commit hooks and a web hook system to write your own.) I host all of my open source stuff there, but you can pay a monthly fee to host private stuff as well.
Gitorious is all about open source. Very similar to github, I haven’t used it, so if anybody has, give us a sales pitch in the comments.
The git site maintains a list here
What we’d like from you
- More links to git hosting resources, like those for dreamhost above
- Your experiences installing gitosis or gitolite and how you resolved them (or links, of course)
- How you or your organization host your repositories