git over http - init
This commit is contained in:
parent
bb445214f0
commit
3cb8520fa5
26
HowtoGit.md
26
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
|
||||
<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 s’ils appartiennent au groupe *git* :
|
||||
|
|
Loading…
Reference in New Issue