GIT HOWTO

From Kolab Wiki

Jump to: navigation, search
This page is a draft only
It is still under construction and content may change. Do not rely on the information on this page.

Contents

Browsing

Browsing is dead simple. Either of the two following URLs will get you to the server repository:

  1. http://git.kolab.org/server
  2. https://git.kolab.org/server

Cloning

Read Only

You may clone the server repository through any of the following commands:

$ git clone git://git.kolab.org/git/server

Note that your copy will be a read-only copy of the repository, and you cannot push out changes should you make any.

Read-Write (for Developers)

Normally, developers would clone the repository using the following URL:

$ git clone git@git.kolab.org:server

This is a gitosis repository access management layer, through which the system needs only the SSH public key for the developer. The mechanism however makes the use of an SSH private/public keypair mandatory. Read more on Gitosis.

Hence, if you have an LDAP account with us, and a proper shell has been assigned to you (e.g. git-shell or bash), the use of an SSH private/public keypair is not compulsory. You can then also use your username and password in the following URL:

$ git clone ssh://<username>@git.kolab.org/git/server

It is recommended you use the latter if possible, but feel free to use the former if you must.

Gitosis

Relevant for Admins and Interested People
Note this information is really relevant only to administrators and people with an interest in what we do here, but not so much to individual developers.


We use Gitosis to, when necessary, make it easier to delegate the creation of new repositories, and add people to the access lists for pulling and pushing to these repositories.

A gitosis.conf file controls which repositories exist, and which groups may or may not have access to read or write from or to said repositories. The current gitosis.conf contents look similar to:

[gitosis]
gitweb = no

[group kolab.org-server]
members = @contributors
writable = server

[group gitosis-admin]
writable = gitosis-admin
members = vanmeeuwen@kolabsys.com wickert@kolabsys.com

[group contributors]
members = <... lots  of identities ...>

To add a repository, one could simply add the name for the new repository and commit/push the changes to the gitosis-admin control repository:

diff --git a/gitosis.conf b/gitosis.conf
index 1636aa3..b07cdbf 100644
--- a/gitosis.conf
+++ b/gitosis.conf
@@ -3,7 +3,7 @@ gitweb = no

 [group kolab.org-server]
 members = @contributors
-writable = server
+writable = server perl-Kolab
 
 [group gitosis-admin]
 writable = gitosis-admin

A user would then, for example, based on an existing repository:

$ cd perl-Kolab
$ git remote add gitosis git@git.kolab.org:perl-Kolab
$ git push gitosis
Personal tools