Live data from Hacker News

How to set up your own private Git server on Linux

tumblr.intranation.com

31–40 of 66 posts

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

#31
post #15
post #14

Earlier quoted context omitted.

In 18 months when you need to a clients project gets deleted and you and find the server version destroyed... well... Might sound unlikely but it happens.

it could also happen that github loses data and it's hard to valuate the exact likelihood of you accidentally deleting two repos or github losing a fileserver and its backup. Also, if github is down or your repo with them is corrupted, you have to go through their support. If your own server has a problem you can fix it instantly. I'm not convinced that reliability is the correct reason to go GitHub. Features: Yes. R…

I'm guessingsure Github does backups.

QED.

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

#32
post #28
post #21

The instructions for adding a public key to the authorized_keys file are a bit reckless, as they will wipe out any others that exist. Although not universal (not included with Mac OS X, for example) the ssh-copy-id command is much preferable. At its most basic: ssh-copy-id example.com Or, to specify a specific key & remote user: ssh-copy-id -i ~/.ssh/id_rsa.pub bob@example.com This will properly append the key, with…

Or... ssh bob@example.com 'cat >> .ssh/authorized-keys' < ~/.ssh/id_rsa.pub

This is not an idempotent operation, and I would not recommend this for anything besides a one-off event.

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

#33
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 don't know, the only problem I found so far is the lack of tag display. It is a bit harder to install than gitosis, but you also get much more (for example, people can create projects and repos without your help, all the visual stuff, etc..)

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

#34

You typically want to enable the post-update hook on the server by mv '${GITDIR}/hooks/post-update.sample' '${GITDIR}/hooks/post-update'. This makes sure that the repository works with dumb servers which is required for things like http/cgit.

.. and chmod +x on it, IIRC

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

#35
post #31
post #15

Earlier quoted context omitted.

it could also happen that github loses data and it's hard to valuate the exact likelihood of you accidentally deleting two repos or github losing a fileserver and its backup. Also, if github is down or your repo with them is corrupted, you have to go through their support. If your own server has a problem you can fix it instantly. I'm not convinced that reliability is the correct reason to go GitHub. Features: Yes. R…

I'm guessing sure Github does backups. QED.

Seeing "I'm guessing" paired with "QED" is... strange to say the least.

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

#38
post #15

Earlier quoted context omitted.

it could also happen that github loses data and it's hard to valuate the exact likelihood of you accidentally deleting two repos or github losing a fileserver and its backup. Also, if github is down or your repo with them is corrupted, you have to go through their support. If your own server has a problem you can fix it instantly. I'm not convinced that reliability is the correct reason to go GitHub. Features: Yes. R…

Sure, Github can lose data. And you can lose data. But the advantage is that you and Github are much less correlated ; the odds that both of you will lose the data at the same time are fairly low. [1] Data safety is all about fighting correlation. You don't back up one partition to another on the same spindle, because when the drive dies the whole spindle is lost. Paranoid people back up to two different drives, two…

Agreed. For that exact reason my main dev machine now has hourly local backups through time machine, local HDD clone backups every 4 hours and a separate offsite backup with Mozy.

In addition to the remote repos on Github and my normal local copies...

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

#39
For simple uses, there are several free git hosting services. Assembla offers unlimited repos and 2GB for free, while ProjectLocker offers unlimited repos and 500MB for free. There are some limitations on tools and sharing and users, but for personal use, these can act just like another repo in the cloud, Yet Another place your private code is copied. No private server maintenance required.

If you do want your own private server, VPSs are getting ridiculously cheap. lowendbox.com relays the latest offer of Open VZ 512MB, 20GB of storage, 1TB of bandwidth, all for ... $3.60/month. At those prices, your backup strategy could simply be to have two, or three, from different vendors. These cheap VPS hosts can just disappear one day, so never have this be your only copy of anything.

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

#40
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!

Installing gitosis was probably the most error-prone and miserable experience I have ever had in Ubuntu system administration. Solid as a rock once I got it up, but man, at the time I had to cobble three different blog posts together with a bit of bubblegum. Obligatory disclaimer: my mental model for both git and sysadminning is not as good as the mean HN reader's.
Post reply on HN