Gitolite administration instructions:

Installation:

  • Create git user, configure its environment - including ${HOME}/bin

  • As git user: git clone git://github.com/sitaramc/gitolite

  • gitolite/install --to ${HOME}/bin

  • Copy admin’s ssh key to system as ${user}.pub, then as git, execute: gitolite setup -pk ${key}

  • From the host where the private key is:

    $ ssh git@wal1155 info
    hello dkoleary, this is git@walsinfmgmt1155 running gitolite3 v3.6.2-20-g78fc240 on git 1.7.1
    
     R W    gitolite-admin
     R W    testing
    
  • Clone the gitolite-admin repo, then configure additional users/repos as needed.

Configuration:

  • Clone the gitolite-admin repo:

    $ git clone git@wal1155:gitolite-admin ./wal1155-gitolite-admin
    Initialized empty Git repository in /ignite/dkoleary/mpi_git/wal1155-gitolite-admin/.git/
    remote: Counting objects: 6, done.
    remote: Compressing objects: 100% (4/4), done.
    remote: Total 6 (delta 0), reused 0 (delta 0)
    Receiving objects: 100% (6/6), done.
    
  • Copy any/all required keys to keydir in the newly cloned local repo

    • cp nap1151-gitolite-admin/keydir/* wal1155-gitolite-admin/keydir

    • cd wal1155; git add -A && git commit -am'new keys'

    • git push

  • If not doing mirroring, configure and/or migrate private/public repos as needed.

Mirroring:

  • Uncomment/Update HOSTNAME parameter in ~git/.gitolite.rc file. HOSTNAME doesn’t have to be the host name but does have to be unique. Once done, compile.

    $ grep HOSTNAME .gitolite.rc | grep -v '#'
    HOSTNAME                  =>  "wal1155",
    $ gitolite compile
    
  • Update ssh environment:

    • On new mirror, create a null passphrased default key:

      $ ssh-keygen -t dsa -P ""
      Generating public/private dsa key pair.
      Enter file in which to save the key (/home/git/.ssh/id_dsa):
      Your identification has been saved in /home/git/.ssh/id_dsa.
      Your public key has been saved in /home/git/.ssh/id_dsa.pub.
      [[snip]]
      
    • Copy newly created id_[rd]sa.pub to gitolite-admin repos in the keydir directory. Resulting filename should be server-${HOSTNAME} as defined aabove. Add/commit/push

    • Create ssh aliases using the hostnames as defined in ~git/.gitolite.rc:

      loglevel=error
      host nap1151
          hostname napsinfmgmt1151
          user git
          ForwardX11 no
      host nap1152
          hostname napsinfmgmt1152
          user git
          ForwardX11 no
      host wal1155
          hostname walsinfmgmt1155
          user git
          ForwardX11 no
      
    • Verify ssh ${gitsvr} info works from all hosts to all hosts.

      $ ssh nap1151 info
      hello server-wal1155, this is git@napsinfmgmt1151 running gitolite3 v3.6.2-4-g2471e18 on git 1.7.1
      
           C  private/CREATOR/..*
      
  • Enable/configure mirroring:

    • On each node,

      • edit ~git/.gitlote.rc. Uncomment ‘Mirroring’ line on/about line 144.

      • Execute gitolite compile as the git user

    • In gitolite master (nap1151) repo, config directory, update mirroring to relfect the new system:

      cd ${mpigit}/nap1151-gitolite-admin/conf
      repo root/scripts
          RW+  = @admins
          RW+  = @san
          option mirror.master     = nap1151
          option mirror.slaves     = nap1152 wal1155
          option mirror.redirectOK = all
      git commit/push
      
    • In the new slave (wal1155 in this case) gitolite-admin repo, update the config to reflect mirroring:

      git clone git@wal1155:gitolite-admin ./wal1155-gitolite-admin
      cd wal1155-gitolite-admin/conf
      repo root/scripts
          RW+  = @admins
          RW+  = @san
          option mirror.master     = nap1151
          option mirror.slaves     = nap1152 wal1155
          option mirror.redirectOK = all
      git commit/push
      
    • Repull the newly mirrored gitolite-admin repo. If it’s not mirrored, log into git@nap1151 and execute:

      gitolite mirror push ${server} gitolite-admin
      
    • Push the other mirrored repos to the new slave. Access git@nap1151 then:

      cd .gitolite/conf
      for d in $(grep ^repo gitolite.conf | awk '{print $NF}' | \
          grep -vi private)
      do
          echo ${d}
          gitolite mirror push wal1155 ${d}
      done