From 3cb8520fa5020fa04360d0c350ec869666ca7036 Mon Sep 17 00:00:00 2001 From: pdiogoantunes Date: Fri, 24 Feb 2017 15:44:21 +0100 Subject: [PATCH] git over http - init --- HowtoGit.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/HowtoGit.md b/HowtoGit.md index 5d4e8750..5e67fba6 100644 --- a/HowtoGit.md +++ b/HowtoGit.md @@ -598,6 +598,32 @@ Cet historique est notamment accessible avec la commande `git reflog`. ## Astuces diverses +### Partager un dépôt en HTTP - simplement + +[https://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html](https://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html) + +Le dépôt git est dans /home/git/projets/projet.git, et le serveur web est Apache2.4. + +~~~{.bash} +SetEnv GIT_PROJECT_ROOT /home/git/ +SetEnv GIT_HTTP_EXPORT_ALL +ScriptAlias /git/ /usr/lib/git-core/git-http-backend/ + +Alias /git /home/git/projets + + AuthType Basic + AuthName "Git HTTP Access" + AuthUserFile /etc/apache2/htpasswd_git + Require user git + +~~~ + +Pour cloner le dépot : + +~~~{.bash} +$ git clone http://git@domain:port/git/projet +~~~ + ### Partager un dépôt avec plusieurs utilisateurs Avec un dépôt *foo* existant, on autorisera les utilisateurs que s’ils appartiennent au groupe *git* :