19
0
Fork 0

git over http - init

This commit is contained in:
pdiogoantunes 2017-02-24 15:44:21 +01:00
parent bb445214f0
commit 3cb8520fa5
1 changed files with 26 additions and 0 deletions

View File

@ -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
<Location /git>
AuthType Basic
AuthName "Git HTTP Access"
AuthUserFile /etc/apache2/htpasswd_git
Require user git
</Location>
~~~
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 sils appartiennent au groupe *git* :