Live data from Hacker News

How to set up your own private Git server on Linux

tumblr.intranation.com

41–50 of 66 posts

Re: How to set up your own private Git server on Linux

#41

I decided to move all my private repositories to my own server. When you do this, make sure that the server has continuous backups. Also, make sure you still have an offsite backup. Once you figure out what these things are worth, you may realize that you should probably just keep paying Github.

My poorman's offsite backup script involves zipping up the repository, encrypt it, and mail it to GMail. The task is scheduled daily and works pretty well.

Re: How to set up your own private Git server on Linux

#42
Earlier this year, I moved from SVN to git when I found I really needed better branch management. One thing I found is that hosting a git repository is a lot less straightforward than hosting a subversion repository, particularly since fewer bug tracking systems have adequate support for DVCS at this point. Trac seems to be lagging behind Redmine in this regard.

If anyone is interested, I created a library for deploying git hosting (or SVN hosting if you really prefer) on a VPS with Redmine project management: http://github.com/ericpaulbishop/redcloud

Git hosting is provided via gitosis, not gitolite since there is no redmine plugin for gitolite support. It runs on Ubuntu VPS and uses Nginx with passenger compiled in as the web server. PHP via php-fpm can optionally be compiled in too, in case other sites on the same box need PHP (as is the case for what I'm doing).

Re: How to set up your own private Git server on Linux

#44
Hi Guys,

This is a question I've been struggling with for a while now.

Would you host your company's super important bread and butter code on GitHub instead of your own server?

I get a funny feeling every time I think about this mostly because I've put tons of time (3 years) into our code base and I think of it as one of the most important aspects of our company.

Then again, GitHub hosts their code on GitHub which makes me feel a bit at ease in doing so.

I would really appreciate your insights.

Thanks!

Re: How to set up your own private Git server on Linux

#45
post #30
post #25

Another good solution is installing gitorious. Especially if you have a big team and a few projects.

I ran throught his this week- Gitorious' install is a bit of a pain, and the software is just BROKEN in places (referencing an array, when the variable is not in one). I like the system, and it's very flexible, but it doesn't seem like they treat it very well for outside use.

I'm working on a VM/ec2 image for Gitorious to ease the installation pain. I'm working from the the Ubuntu installation script that the Gitorious project provides, and I will try to get the improvements merged upstream. Things are mostly working, so I will be making the work public after a few more days of testing. Feel free to contact me if you'd like more info.

Re: How to set up your own private Git server on Linux

#46
post #7

I decided to move all my private repositories to my own server. When you do this, make sure that the server has continuous backups. Also, make sure you still have an offsite backup. Once you figure out what these things are worth, you may realize that you should probably just keep paying Github.

The backups aren't as important as each git repo is a fully blown code. If your local repo is destroyed, you still have the server copy. If your server blows up, you still have the local copy. There are many other good reasons for a service like Github, like the excellent collaboration features, the really good repository and history browser or the good bugtracker. If you don't need those (small team, working alone)…

What legal issues/other issues from uploading your code to GitHub are you worried about?

I can't imagine that GitHub would steal your code. They've never heard of you, they have no reason to believe your code is worth anything to them, and one "I have pretty damn good evidence that GitHub stole my code" could ruin their entire business.

You mentioned legal issues. Are you afraid someone's going to ... subpoena your code or something? Because if that happens, you'd have to turn it over anyway.

They've got some pretty intense-looking security[1], and people like Twitter trust them with their code[2]. If they aren't worried, why are you?

1: http://help.github.com/security/

2: I don't know that that's officially known, but I saw Twitter commenting on the "GitHub now has Organizations" post complaining about the lack of the cheaper plan that they added the next day. So they definitely have some private repos on GitHub.

Re: How to set up your own private Git server on Linux

#47

I decided to move all my private repositories to my own server. When you do this, make sure that the server has continuous backups. Also, make sure you still have an offsite backup. Once you figure out what these things are worth, you may realize that you should probably just keep paying Github.

You have to have backups on server anyway. And setting offsite backups to amazon s3 is like 30 mins of work and may be $1 per month in s3 costs. and this will backup not only your git repositories, but the whole server.

Re: How to set up your own private Git server on Linux

#50
post #5
post #4

I highly recommend using Gitosis; it makes managing teams, projects and users a breeze. It's really nifty: you get a git repo that contains the ssh keys and config file to manage the system. Add the user's key, add the user to the config file, push, and you're done!

I don't see any reason to run gitosis when there's gitolite, even for a single user. Either is definitely preferable to doing things manually, though.

I just went throught gitolite's readme, and I don't see any reason why a lone dev might want to use it, since it seems to be built for managing teams with access control needs.

Doing it manually for me just means (on the server):

      mkdir project_name
      cd project_name
      git init --bare
Hardy difficult.

I already have ssh keys set up from long back, so that's all I have to do really. Then I just add the remote repository on my local machine.

Post reply on HN