User Tools

  • Logged in as: anonymous (anonymous)
  • Log Out

Site Tools


mantisbt:gitosis_management

This is an old revision of the document!


Managing Gitosis Repositories

Author: John Reese

Concepts

Gitosis stores repositories in the 'git' user's home directory. In the case of git.mantisbt.org, this path is /srv/git. Configuration of the hosted repositories is defined in a special repository gitosis-admin.git, which contains a single configuration file and a directory of users' SSH keys.

Gitosis does its magic via the post-update hook in the gitosis-admin repository; in other words, every time you push changes to the special repository, it automatically updates all the appropriate settings, files, etc on the server to match the new configuration.

Repository Layout

The gitosis-admin repository maintains a special structure of information. When checked out, it looks like this:

  gitosis-admin/
      gitosis.conf
      keydir/
          jreese.pub
          ....

The file gitosis.conf contains configuration information for all the repositories managed by Gitosis, including the gitosis-admin repo. It defines repositories and groups of users, and associated read/write privileges.

Because Git/Gitosis relies on SSH access for users to push changes to repositories, users are identified by their public SSH keys. The keydir/ directory contains all users' public keys in the filename format of <username>.pub.

Repository Management

This process assumes you have been granted admin access to Gitosis on the server.

General Process

Start by cloning the gitosis-admin repository. Naturally, you only need to do this once; any later changes to the repository can be handled using the same clone.

$ git clone git@mantisbt.org:gitosis-admin.git

Now that you have a successful clone, you can make your changes. Once you're done making changes, commit your changes, and push them back to the server.

$ git commit -a -m "<What you just did>"
$ git push

Gitosis will then handle updating all the repositories appropriately. You're done!

References

[1] http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way

[0] Gitosis example.conf (Snipped unappliccable parts)

# this config file tries to show a bit of everything, most real life
# configurations really only need a "group" section with "members" and
# "writable"

[gitosis]


[group quux]
members = jdoe wsmith @anothergroup
writable = foo bar baz/thud
readonly = xyzzy

## You can use groups just to avoid listing users multiple times. Note
## no writable= or readonly= lines.
[group anothergroup]
members = alice bill

## You can play fancy tricks by making some repositories appear with
## different names in different contexts. Not really supported
## everywhere (e.g. gitweb) and can be confusing -- experts only.
map writable visiblename1 = actualname1
map readonly visiblename2 = actualname2

[repo foo]
## Oneline description of the project, mostly for gitweb.
description = blah blah

## Owner of this repository. Used in gitweb list of projects.
owner = John Doe
mantisbt/gitosis_management.1225914203.txt.gz · Last modified: 2008/11/05 15:00 (external edit)

CC Attribution-Noncommercial-Share Alike 4.0 International Driven by DokuWiki