Questions tagged [gitolite]

Gitolite allows you to setup a centralised Git server, with very fine-grained access control and mother powerful features.

Gitolite lets you use a single user on a server to host many git repositories and provide access to many developers, without having to give them real userids on or shell access to the server. The essential magic in doing this is ssh's pubkey access and the authorized_keys file, and the inspiration was an older program called gitosis.

Gitolite can restrict who can read from (clone/fetch) or write to (push) a repository. It can also restrict who can push to what branch or tag, which is very important in a corporate environment. Gitolite can be installed without requiring root permissions, and with no additional software than git itself and perl. It also has several other neat features described below and elsewhere in the doc/ directory.

Gitolite is separate from git, and needs to be installed and configured. So... why do we bother?

Gitolite is useful in any server that is going to host multiple git repositories, each with many developers, where some sort of access control is required.

In theory, this can be done with plain old Unix permissions: each user is a member of one or more groups, each group "owns" one or more repositories, and using unix permissions (especially the setgid bit -- chmod g+s) you can allow/disallow users access to repos.

But there are several disadvantages here:

  • every user needs a userid and password on the server. This is usually a killer, especially in tightly controlled environments
  • adding/removing access rights involves complex usermod -G ... mumblings which most admins would rather not deal with
  • viewing (aka auditing) the current set of permissions requires running multiple commands to list directories and their permissions/ownerships, users and their group memberships, and then correlating all these manually
  • auditing historical permissions or permission changes is pretty much impossible without extraneous tools
  • errors or omissions in setting the permissions exactly can cause problems of either kind: false accepts or false rejects
  • without going into ACLs it is not possible to give someone read-only access to a repo; they either get read-write access or no access
  • it is absolutely impossible to restrict pushing by branch name or tag name.

Gitolite does away with all this:

  • it uses ssh magic to remove the need to give actual unix userids to developers
  • it uses a simple but powerful config file format to specify access rights
  • access control changes are affected by modifying this file, adding or removing user's public keys, and "compiling" the configuration
  • this also makes auditing trivial -- all the data is in one place, and changes to the configuration are also logged, so you can audit them.
  • finally, the config file allows distinguishing between read-only and read-write access, not only at the repository level, but at the branch level within repositories.

Main Features

The most important feature I needed was per-branch permissions. This is pretty much mandatory in a corporate environment, and is almost the single reason I started thinking about writing gitolite.

It's not just "read-only" versus "read-write". Rewinding a branch (aka "non fast forward push") is potentially dangerous, but sometimes needed. So is deleting a branch (which is really just an extreme form of rewind). I needed something in between allowing anyone to do it (the default) and disabling it completely (receive.denyNonFastForwards or receive.denyDeletes).

Some more features - all of them, and more, are documented in detail somewhere in gitolite's doc/ subdirectory:

  • simple, yet powerful, config file syntax, including specifying gitweb/daemon access. You'll need this power if you manage lots of users+repos+combinations of access
  • apart from branch-name based restrictions, you can also restrict by file/dir name changed (i.e., output of git diff --name-only)
  • if your requirements are still too complex, you can split up the config file and delegate authority over parts of it
  • easy to specify gitweb owner, description and gitweb/daemon access
  • easy to sync gitweb (http) authorisation with gitolite's access config
  • comprehensive logging [aka: management does not think "blame" is just a synonym for "annotate" :-)]
  • "personal namespace" prefix for each dev
  • migration guide and simple converter for gitosis conf file
  • "exclude" (or "deny") rights at the branch/tag level
  • specify repos using patterns (patterns may include creator's name)
  • define powerful operations on the server side, even github-like forking

Support

Most installation problems are caused by not knowing ssh. Take a look at this transcript to see how simple it actually is, if your server's ssh daemon is behaving itself. Someone also wrote a tutorial, see here.

If I suspect your problem is an ssh issue, I will probably ignore it. Please learn how gitolite uses ssh and then methodically go through the ssh trouble shooting document. These two documents contain everything I could possibly tell you. I have nothing to add.

Even for other topics, please look through at least the table of contents of at least the numbered documents to see if your question is already answered, before asking.

Security

Due to the environment in which this was created and the need it fills, I consider this a "security" program, albeit a very modest one.

For the first person to find a security hole in it, defined as allowing a normal user (not the gitolite admin) to read a repo, or write/rewind a ref, that the config file says he shouldn't, and caused by a bug in code that is in the "master" branch, (not in the other branches, or the configuration file or in Unix, perl, shell, etc.).

However, there are a few optional features (which must be explicitly enabled in the RC file) where I just haven't had the time to reason about security thoroughly enough. Please read the comments in conf/example.gitolite.rc for details, looking for the word "security".

License

Gitolite is released under GPL v2.

86 questions
41
votes
2 answers

How could I stop ssh offering a wrong key?

(This is a problem with ssh, not gitolite) I've configured gitolite on my home server (ubuntu 12.04 server, open-ssh). I want an special identityfile to administer the repositories, so I need to access throught ssh to my own host ussing two…
Alvaro Maceda
  • 523
  • 1
  • 4
  • 5
12
votes
1 answer

How well does authorized_keys scale?

If I'm using something like gitolite to handle access control how well does authorized_keys scale? Meaning if I have say 50,000 users what will the performance be like (I'm guessing not very good). What are the alternatives? Update: I decided to do…
Jeremy
  • 123
  • 7
10
votes
2 answers

git on HTTP with gitolite and nginx

I am trying to setup a server where my git repo would be accessible with HTTP(S). I am using gitolite and nginx (and gitlab for web interface but I doubt it makes any difference). I have searched the whole afternoon and I think I'm stuck. I have…
Arnaud
  • 209
  • 2
  • 5
9
votes
5 answers

Replace gitolite3 user with git

I am installing gitolite3 on a server, with ssh and http pulling/pushing/alltherest. During the process, a user and group gitolite3 is created. When I run: $ ssh gitolite3@server info I get the correct gitolite3 message with RW repo…
Florian Mertens
  • 403
  • 4
  • 9
8
votes
3 answers

How do I provide dpkg configuration parameters to aptitude or apt-get?

When installing gitolite I find that: # aptitude install gitolite The following NEW packages will be installed: gitolite 0 packages upgraded, 1 newly installed, 0 to remove and 29 not upgraded. Need to get 114 kB of archives. After unpacking 348…
troutwine
  • 1,382
  • 5
  • 16
  • 32
6
votes
2 answers

Gitolite clone not working as intended

I am running a Debian system, and have recently installed gitolite using the DEB package. Here is my problem: I have tried to clone the gitolite-admin.git repository (which is used for configuring the gitolite installation for all repositories that…
invalidsyntax
  • 247
  • 2
  • 8
5
votes
3 answers

Redmine 2.x with gitolite integration

Has someone here correctly configured Redmine 2.x (I'm using Redmine 2.0.3) with gitolite? If yes, how?
boos
  • 631
  • 1
  • 6
  • 8
5
votes
1 answer

Gitolite, how to include .conf file with a relative path?

I'm running a Gitolite server, and I was thinking of having 1 config file per repository. For now I've this gitolite.conf file: @php_dev = userA userB @int_dev = userC @lead = userD @admin = @php_dev repo gitolite-admin RW+ = …
FMaz008
  • 429
  • 3
  • 12
4
votes
1 answer

How can I configure git to reject large files?

For the 3rd time a developer committed a large file in our git repository (over 100MB). It's really a pain to cleanup. How can I configure git and/or gitolite to prevent large files from ever being committed into the repo? Thanks a lot.
MiniQuark
  • 3,695
  • 2
  • 20
  • 23
4
votes
3 answers

user unable to connect to git (using gitolite on ubuntu)

I was able to run the following command: git clone admin@ip address:gitolite-admin.git When I tried adding a new user using the steps below, the new user was unable to connect: Steps taken so far: 1. Copied the public key into the keydir (also…
ali haider
  • 1,120
  • 3
  • 15
  • 26
4
votes
2 answers

Moving Gitlab and Gitolite server to another machine

Now, I have gitlab and gitolite running on my ubuntu server. However, this server is too slow and my company wish to move the server to another machine. Are there any way to move gitlab and gitolite server( the whole files, users and setting) to…
Sam Mie
  • 49
  • 1
  • 2
4
votes
2 answers

Can't clone gitolite-admin

I'm trying to setup gitolite on my server which is a mac mini running os X leopard (non-server version). I believe I correctly installed gitolite using the root installation method detailed on…
latca
  • 41
  • 3
4
votes
1 answer

Update Git super repository automatically when a submodule gets updated

in our company we have a huge code base (>100000 files) and so we keep it in several git repositories. So we have a forest of repositories and one super repository containing only submodule references on top of that. The idea is to have the super…
filodej
  • 41
  • 2
3
votes
2 answers

I'm having some trouble setting up IP restrictions with Gitolite

I'm having trouble setting up IP restrictions with Gitolite. It may be something simple and this is my first time using it (I'm finally switching from Gitosis because it can't do what I need it to) Basically my client sites each have a git repo. I…
3
votes
4 answers

GIT server with username and password authentication

I would like to set a GIT server and let my developers to login using username and password in order to commit and make changes to the projects. I need also to manage developer access to projects (I think I should use gitolite for this). How can I…
Giorgio
  • 31
  • 1
  • 2
1
2 3 4 5 6