Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Say I wanted to setup a server, where I could create GIT repositories for users. I would only give them access via SSH.

I would need to restrict them to say 100megs or 1 gig etc.

Is this a complicated setup or one of the more straight forward setups?

share|improve this question

closed as too broad by masegaloeh, Jenny D, Jim B, ceejayoz, Scott Pack Apr 23 '15 at 2:22

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

All you need is ssh access to a machine with git installed. Just make sure you lock down the accounts with quotas and other precautions. Use "git-shell" for the accounts, and you're all set.

share|improve this answer

A friend showed me Gitosis. I use this to set up my repositories (it manages permissions based on SSH key, etc), but it won't help with the quotas.

share|improve this answer

I was asked to do this recently. I found these links helpful:

Between these two things, I have happy engineers.

share|improve this answer

This would be a fairly straightforward setup once you have a Linux server up and running. To limit disk space on a per-user or per-group basis, you'd want to set up quotas. Here's a good guide to use as an example.

Since your users will have SSH access, you don't necessarily need to set up any sort of fancy git server (like Gitosis) unless you want to have special permissions. Even then, you could use ACLs to handle that.

As for actually creating the git repositories, it's as simple as this:

cd /srv/git/somerepo.git/
git init --bare

...and then setting the correct permissions.

The users can then clone their git repository using a command like this:

git clone ssh://username@server/srv/git/somerepo.git/
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.