Gitosis2Gitolite

Clone

mnombre@u-nm:~$ git clone ssh://gitolite@199.84.140.58/gitolite-admin
Clonage dans 'gitolite-admin'...
warning: Vous semblez avoir cloné un dépôt vide.
Vérification de la connectivité... fait.
mnombre@u-nm:~$ cd gitolite-admin/
mnombre@u-nm:~/gitolite-admin$ ls -al
total 12
drwxrwxr-x  3 mnombre mnombre 4096 mar 10 15:07 .
drwx------ 51 mnombre mnombre 4096 mar 10 15:07 ..
drwxrwxr-x  7 mnombre mnombre 4096 mar 10 15:07 .git
mnombre@u-nm:~/gitolite-admin$ ls -al .git/
total 40
drwxrwxr-x 7 mnombre mnombre 4096 mar 10 15:07 .
drwxrwxr-x 3 mnombre mnombre 4096 mar 10 15:07 ..
drwxrwxr-x 2 mnombre mnombre 4096 mar 10 15:07 branches
-rw-rw-r-- 1 mnombre mnombre  268 mar 10 15:07 config
-rw-rw-r-- 1 mnombre mnombre   73 mar 10 15:07 description
-rw-rw-r-- 1 mnombre mnombre   23 mar 10 15:07 HEAD
drwxrwxr-x 2 mnombre mnombre 4096 mar 10 15:07 hooks
drwxrwxr-x 2 mnombre mnombre 4096 mar 10 15:07 info
drwxrwxr-x 4 mnombre mnombre 4096 mar 10 15:07 objects
drwxrwxr-x 4 mnombre mnombre 409

Copie des clés ssh

mnombre@u-nm:~/gitolite-admin$ cp -av ../gitosis-admin/keydir .

changement de ma clé (je mets ma nouvelle clé spécifique gitolite)

mnombre@u-nm:~/gitolite-admin$ rm keydir/moussa.nombre.pub; cp ~mnombre/.ssh/nm_gitolite.pub keydir/moussa.nombre.pub

Convert

mnombre@u-nm:~/gitolite-admin$ scp 199.84.140.58:/usr/share/gitolite/gl-conf-convert /home/mnombre/Bureau/
gl-conf-convert        100% 3396     3.3KB/s   00:00 
mnombre@u-nm:~$ ~mnombre/Bureau/gl-conf-convert < gitosis-admin/gitosis.conf >> gitolite-admin/conf/gitolite.conf
mnombre@u-nm:~$ 

Be sure to check the file to make sure it converted correctly http://gitolite.com/gitolite/gitolite.html#gsmigr

diff --git a/etc/gitweb-prive.conf b/etc/gitweb-prive.conf
index 4be4717..415bbcc 100644
--- a/etc/gitweb-prive.conf
+++ b/etc/gitweb-prive.conf
@@ -1,6 +1,6 @@
 # path to git projects (<project>.git)
 #$projectroot = "/var/cache/git";
-$projectroot = "/srv/gitosis/repositories";
+$projectroot = "/srv/gitolite/repositories";
 
 # directory to use for temp files
 $git_temp = "/tmp";
@@ -19,23 +19,23 @@ $site_name = "Dépôts git de l'AuF";
 
 # file with project list; by default, simply scan the projectroot dir.
 #$projects_list = $projectroot;
-$projects_list = "/srv/gitosis/gitosis/projects-prive.list";
+$projects_list = "/srv/gitolite/gitolite/projects-prive.list";
 $projects_list_description_width = 50;
 $export_ok = "";
 $strict_export = "true";
 @git_base_url_list = ('git://git.auf.org');
 
 # stylesheet to use
-$stylesheet = "gitweb.css";
+$stylesheet = "static/gitweb.css";
 
 # javascript code for gitweb
-$javascript = "gitweb.js";
+$javascript = "static/gitweb.js";
 
 # logo to use
-$logo = "git-logo.png";
+$logo = "static/git-logo.png";
 
 # the 'favicon'
-$favicon = "git-favicon.png";
+$favicon = "static/git-favicon.png";
 
 # tout est Unicode par défaut
 $default_text_plain_charset = "utf-8";

test-git:/srv# mv gitosis gitosis-FRIGO
test-git:/srv# cp gitosis-FRIGO/gitosis/projects-prive.list gitolite/
test-git:/srv# chown gitolite: gitolite/projects-prive.list

.... On n'a rien sur l'interface web :(..., juste un "404 - No projects"


dpkg-reconfigure gitolite

des erreurs (du fait que ce soit fait sous root ?):

test-git:/srv/gitosis# dpkg-reconfigure gitolite
creating gitolite-admin...
fatal: GIT_WORK_TREE (or --work-tree=<directory>) not allowed without specifying GIT_DIR (or --git-dir=<directory>)
could not symlink /srv/gitolite/.gitolite/hooks/common/gitolite-hooked to hooks
fatal: Not a git repository: '/.git'
error: could not lock config file /.git/config: Permission non accord?e
error: could not lock config file /.git/config: Permission non accord?e
fatal: Not a git repository: '/.git'
could not symlink /srv/gitolite/.gitolite/hooks/common/gitolite-hooked to ./gitolite-admin.git/hooks
fprint failed

mais dossier créé :

test-git:/srv/gitosis#ls -al /srv/gitolite/
total 28
drwxr-xr-x 5 gitolite gitolite 4096 mar 10 11:15 .
drwxr-xr-x 7 root     root     4096 mar 10 11:15 ..
drwx------ 8 gitolite gitolite 4096 mar 10 11:15 .gitolite
-rw-r--r-- 1 gitolite gitolite 4217 mar 10 11:15 .gitolite.rc
drwx------ 3 gitolite gitolite 4096 mar 10 11:15 repositories
drwx------ 2 gitolite gitolite 4096 mar 10 11:15 .ssh
test-git:/srv/gitosis#

WARNING: keydir/<yourname>.pub duplicates a non-gitolite key, sshd will ignore it

You used a key that is already set to give you shell access. You cannot use the same key to get shell access as well as access gitolite repos.

Solution: use a different keypair for gitolite. There's a wee bit more on this in the setup section of the install page. Also see why bypassing causes a problem and both the pages linked from ssh for background.

2.1.2.5 setup

For the first-time setup, you need to have a public key file (usually from the admin's workstation) ready. If the main gitolite admin's username is "alice", this file should be named "alice.pub" and copied to the server.

Once that is done, run:

gitolite setup -pk alice.pub
If that completes without any warnings, you are done. If it had a warning, you probably supplied a key which already has shell access to the server. That won't work; you'll have to generate and use a different key pair for gitolite access and use host aliases to distinguish between the two. While you're there, read both the ssh pages. Twice.


ZA/Montréal/MigrationJessie/Gitosis2Gitolite (dernière édition le 2016-03-28 18:57:15 par MoussaNombre)