Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 653 Bytes

note_2016-05-11_23-47-41_git-server-ssh.md

File metadata and controls

27 lines (18 loc) · 653 Bytes

Utiliser Git à travers SSH

Créer un utilisateur 'git':

$ adduser git --create-home
$ sudo chsh git
    "/usr/bin/git-shell"

Puis créer un depot distant vide distant:

$ sudo -iu git
$ mkdir /git-rep
$ cd /git-rep
$ mkdir repository-name
$ cd repository-name
$ git init --bare

Puis ajouter l'origine dans le depot à pousser, et pousser:

$ git remote add origin ssh://git@host:port/path/to/rep-rep
$ git push origin master

Pour cloner:

$ git clone ssh://git@host:port/git-rep/repository-name

Pour utiliser des clefs, modifier ".ssh/config". Voir la note sur l'utilisation des clefs et de SSH.