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
1
vote
0 answers

Gitweb to check access rights with gitolite

I'm several git repositories accessible to different users. I want to allow the users to browse all repos he or she has at least READ access to. To achieve this I have the following gitweb config: $projectroot =…
1
vote
1 answer

How config git email notification

Could your advice information (script) to config git notification. We have many projects and team working with them. It will be better if team member could get email notification when another push.
Stepchik
  • 99
  • 4
  • 11
1
vote
0 answers

Git push write access for deployment denied

I have strange issue when try git push. Git clone and commit works fine. W access for my_project DENIED to deploy_my_project_ My gitolite.conf repo my_project R = deploy_my_project_111 RW+ = my_name I wonder why git push takes wrong user…
Stepchik
  • 99
  • 4
  • 11
1
vote
1 answer

gitolite behind haproxy

is there a way to have a gitolite behind haproxy? I have my repo on a private server behind haproxy, but what is the way to clone/push/etc on this server from the internet? Thanks in advance.
Francesco
  • 19
  • 1
1
vote
1 answer

Gitolite w. Gitweb and Wildcard Repos

with a gitolite configuration like this: repo    users/CREATOR/.+ C       =   @defaultgroup RW+D    =   CREATOR RWD     =   @defaultgroup the users of our server can easily create their own repositories just…
pagid
  • 127
  • 8
1
vote
1 answer

Gitolite SSH URL Format

So I got gitolite set up. Simple. But there is one issue I am having. The SSH urls follow the format of git@host:repo. I'm used to Bitbucket / Github where the urls follow the format of git@host:user/repo. Is there a way to get the latter format…
knpwrs
  • 357
  • 1
  • 4
  • 14
1
vote
1 answer

Mechanism behind user forwarding in ScriptAliasMatch

I am following this tutorial to setup gitolite and at some point the following ScriptAliasMatch is used: ScriptAliasMatch \ "(?x)^/(.*/(HEAD | \ info/refs | \ objects/(info/[^/]+ | \ [0-9a-f]{2}/[0-9a-f]{38} | \ pack/pack-[0-9a-f]{40}\.(pack|idx)) |…
jolivier
  • 141
  • 1
  • 9
1
vote
2 answers

Gitolite and Gitlab - How the `www-data` user can checkout?

I have just installed Gitolite and Gitlab and I am very happy with it. Everything works fine so far. I can create repos, push to them, clone them on other clients on the network. Great! But now I wanted to do some post-receive hooks. I.e. when I…
1
vote
1 answer

change gitolite from manual installation to package

I want to change my manually installed gitolite to the package installation, because it's easier to updates. How can I do that, without loosing my repositories? / How can I backup my repositories, before I start playing around with gitolite…
sbo
  • 143
  • 1
  • 3
1
vote
0 answers

gitolite.conf - Write and rewind permissions (W+) are being lost everytime a git push occurs

At my company, we are adopting Redmine as the support tool for our software projects management. Since we were using git for SCM, I've installed and configured the Redmine git hosting plugin and gitolite, since its a plugin requirement. In the…
Rui Gonçalves
  • 195
  • 2
  • 8
1
vote
1 answer

gitolite on ubuntu 12 always asking for password when trying to clone gitolite-admin

after several hours of googling and trying (and reading several posts on this page) I still do not know what I am doing wrong. So I would be very happy, if somebody could help me here... I updated Ubuntu 11.10 to 12.4 LTS and thus had to switch vom…
vitr
  • 11
  • 3
1
vote
2 answers

Is it possible to run gitolite on a FreeNAS server?

We make extensive use of gitolite, both for code management and to host private SparkleShare repositories. I'm looking at building a FreeNAS storage machine, and got to thinking that it runs bsd, has ssh, and therefore should theoretically have all…
Bryan Agee
  • 1,179
  • 2
  • 10
  • 27
1
vote
2 answers

from svn to git (+ LDAP + password-less updates + passworded access control)

We have an SVN setup and there are some things we dislike about it and some things we like about it. We want to move to git, but we're not sure exactly what setup will work for us. We're currently using SVN (w/ Authz) + Apache (w/ WebDAV &…
Jayen
  • 1,827
  • 3
  • 16
  • 27
1
vote
1 answer

Why does this preseed for gitolite fail?

I'm installing gitolite on a Debian Squeeze box with the following preseed: gitolite gitolite/gituser string git gitolite gitolite/adminkey string ssh-rsa AAAAB3ECT gitolite gitolite/gitdir string …
troutwine
  • 1,382
  • 5
  • 16
  • 32
1
vote
2 answers

Install gitolite without needing public key(s)?

All of our developers run Windows workstations. We run a Linux development server. I've been wanting to try out running our own git server on the dev server. After some research I've settled on trying to install gitolite. A lot of the tutorials on…
Jake Wilson
  • 8,494
  • 29
  • 94
  • 121