Gitosis Cheatpage


Table of Contents


1. Installation

1.1 etch

  1. Enable backports repository
    # echo "deb http://ftp.debian-unofficial.org/debian-backports/ etch-backports main contrib non-free" \
    	>> /etc/apt/sources.list
    
  2. Update package indices
    # apt-get update
    
  3. Install archive keyring
    # apt-get install --allow-unauthenticated -t etch-backports debian-unofficial-archive-keyring
    
  4. Update indices again
    # apt-get update
    
  5. Install gitosis
    # apt-get install -t etch-backports gitosis
    
^

1.2 lenny/sid

^

2. Configuration

^

3. Operations

3.1 Add key

  1. Checkout gitosis configuration
    $ git clone git@server:gitosis-admin.git
    
  2. Put public key into gitosis-admin/keydir

    Note: the name of the file must match the criteria name@hostname.pub whereas name and hostname have to be identical what is listed at the end of your ssh-key. The following ssh key:
    ssh-dss [...] daniel@debian
    
    translates to the file keydir/daniel@debian.pub.

  3. Use the name in any members= stanza in gitosis.conf.

    Note: the name of the member has to be name@hostname and not <name@hostname.pub.
^

3.2 Add repository

  1. Checkout gitosis configuration
    $ git clone git@server:gitosis-admin.git
    
  2. Edit gitosis configuration
    $ cd gitosis-admin
    $ vi gitosis.conf
    
  3. Add your repository
    [repo myproject]
    gitweb = yes
    description = My project
    owner = My Name
    
  4. Add write access
    [group projects]
    ...
    writable = ... myproject
    
  5. Checkin new configuration
    $ git commit -a -m "Adding myproject."
    $ git push
    
  6. Create your repository
    $ mkdir myproject
    $ cd myproject
    
    $ git init
    $ git remote add origin git@server:myproject.git
    
  7. Copy your own stuff into the directory

  8. Commit to your repository
    $ git add .
    $ git commit -a -m "Initial import of myproject."
    
  9. Push to your repository
    $ git push origin master
    
  10. Checkout your repository
    $ git clone git@server:myproject.git
    
  11. Bugfix for gitweb

    If gitweb does not list your repository, execute on the server:
    # chmod 0755 /var/cache/git/repositories/myproject.git
    
^

-- Daniel Baumann <daniel@debian.org> Sun, 27 Jan 2008 10:47:00 +0100