Live data from Hacker News

How to Host Your Own Private Git Repositories

eklitzke.org

61–70 of 114 posts

Re: How to Host Your Own Private Git Repositories

#61
As others have already stated, this article is a great introduction for when you'll be the only one to access the repositories, as anyone able to authenticate for that account will have access to all repos.

There are some tools that restrict access with varying levels of granularity, but if you just want to restrict access on a per-repo-per-sshkey basis, one of my projects is a simple shell script that does just that:

https://github.com/cbdevnet/fugit

It originally came to be because I've found gitolite too big to maintain for simply sharing some repositories with a few other people. It has since served me well and is used in some business applications, too.

Re: How to Host Your Own Private Git Repositories

#64
post #52
post #40

Earlier quoted context omitted.

My impression is that GitLab is a web application. It does not really serve the same use case. Web access is good for open source projects where people may want to read the source without downloading the full repo. In the case of private projects, chances are that everyone involved will want to clone the whole repo anyways.

I don't mean to be pedantic, but Gitlab helps to host your own private git repos, which fits the title of the article. The article goes further, giving an example of how you can do some bare metal git hosting on a lightweight VM. It's the same as running postfix/dovecot for configuring your own mail server (which could run on a lightweight VM), or using a turnkey solution such as Zimbra (which will include spam/virus…

[deleted]

Re: How to Host Your Own Private Git Repositories

#65
post #60

Gitlab also can be run in your own server. It actually has an enterprise and an open source version. We use the open source one for a couple of years and it is really great - I recommend it with all my heart. It has great instructions for installing directly from source and you don't really need to be familiar with ruby to install it. It requires some standard components (web server, database) which should exist on a…

Gitlab is massive though. I think it's a great solution for teams on dedicated hardware, but if you need something quick, low-maintenance and lightweight Gitlab might be a bit overkill.

You can't get much quicker or low maintenance than gitlab, though it is definitely not lightweight.

Re: How to Host Your Own Private Git Repositories

#66

Earlier quoted context omitted.

> Why do this when http://bitbucket.com will host private git repos for free? Because you never know when one of these online services will suffer an outage, suffer a security breach that leasks your private repos or email & credentials, or even lose your data entirely. The fact that the service is free doesn't mean that it doesn't come without potential issues.

But... you are using another online service to host the service yourself, no? And presumably they are also throwing in backups and redundancy of some sort... certainly it would take you a minute to set those things up, test them, monitor they are working... And isn't GitHub basically like everyone's resume these days? I don't know... at some point you sort of just have to trust someone... be it the hosting provider,…

My company uses github, and it's been down enough to significantly impact work about a dozen times in the past 3 years. There were periods before that where github would be down enough to cause CI or CD builds to fail on a daily basis for months. Still, It's probably worth it for what we pay and the service we get for us to continue using github, even with outages. However, for my personal repos, I host the primary repo on my own infrastructure on my own network on my own property, using only software that is licensed under a free/oss license. I mirror public repos to github as a way of publishing the work, but I'm not going to get caught having to make a tough/expensive decision when Github changes their service plans again.

Re: How to Host Your Own Private Git Repositories

#67

Why do this when http://bitbucket.com will host private git repos for free? They also have have Large File Storage implemented as well. I use GitHib client using BitBucket for repo hosting with LFS and it works great, no need to host anything.

Because maybe for security reasons you want to host it on a server internal to your organization's network.

Re: How to Host Your Own Private Git Repositories

#68
For those who aren't aware, Git is actually a fully decentralised system. It doesn't require a central server as such - though most teams use one, as it's a convenient setup for most projects.

Even if you are hosting on github/bitbucket/et. al. though, that repository is just one of many equals. You can push and pull from multiple peers as long as you have access set up appropriately.

I recommend the chapter on distributed workflows in Pro Git:

https://git-scm.com/book/en/v2/Distributed-Git-Distributed-W...

There's also an explanation of the different supported protocols here:

https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protoco...

Re: How to Host Your Own Private Git Repositories

#69

Earlier quoted context omitted.

LFS is a tool to use to avoid checking in 7 gb files. If you want to weigh down your repo with binary bloat, don't configure your repo to use LFS.

Have you tried setting up LFS on your self-hosted ssh git repo? Turns out LFS is designed to authenticate over https and doesn't work at all with ssh credentials out of the box because f* you. I'm still hoping for a native git feature for large files, so the git-lfs crap can die in a fire.

LFS was developed by GitHub, a company that depends on people thinking it's "too hard" to run their own DVCS repo hosting.

Compare this with the Mercurial LargeFiles extension, which needs nothing more than a line in the .hgrc on each end (client/server) to enable it.

Re: How to Host Your Own Private Git Repositories

#70
post #49

Earlier quoted context omitted.

Why not just set standard file permissions (owner and group)? You could create a group for each repository, and add and remove members as necessary.

This is precisely what I do. But, I'd prefer it if git-shell didn't let users probe and read git repositories at any absolute path on the remote end. That's not great behavior for a restricted shell.

Remove the 'others' read/execute permission from user home directories.
Post reply on HN