Live data from Hacker News

How to set up your own private Git server on Linux

tumblr.intranation.com

21–30 of 66 posts

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

#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 the bonus of securing the permissions of the remote user's home, ~/.ssh, and ~/.ssh/authorized_keys.

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

#23
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…

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 different disk controllers, two different machines, two different datacenters, two different continents...

---

[1] But nonzero. It is worth thinking about the scenarios.

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

#24

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 should already have those things in place for your server. I don't think that the marginal cost of managing git is much if you're already managing a database, web server, application, mail server, and so on.

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

#26

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.

Daily, weekly and snapshot backups with Linode are $5 on top of what I'm paying them anyway (and just a few clicks to set up). That's less than the cost of GitHub's micro plan and I can have as many private repos as I want.

I love GitHub and I'm sure they'll continue to do well, but running your own Git server is only going to get easier. If you don't need the social side of what they offer, hosting yourself makes sense.

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

#27
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…

Agree 100%. Furthermore, it's important not to conflate version control with data backup. Although they share some traits, they have different goals. For example, if I lose my local working copy of a repository before any commits, I've lost valuable work. In absence of a good backup strategy, the existence of the remote repository is of little consolation.

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

#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

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

#29
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…

Fair point, I'll update my instructions with a warning, and a version of your commands that works for OS X as well (OS X lacks ssh-copy-id). The instructions are intended for new server builds (hence installing Git etc.).

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

#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.

Post reply on HN