Outils pour utilisateurs

Outils du site


tech:git_over_https_-_conf_client

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tech:git_over_https_-_conf_client [2025/11/05 11:45] Jean-Baptistetech:git_over_https_-_conf_client [2026/06/19 10:05] (Version actuelle) Jean-Baptiste
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Brouillon git TLS CA}}
 +
 +
 +# Git over HTTPS - conf client
 +
 +Voir aussi :
 +* [[Notes git et cerfificats HTTPS]]
 +
 +
 +~~~bash
 +git clone https://user@git.acme.fr/user/projet
 +~~~
 +
 +
 +## Méthode credential.helper
 +
 +~~~bash
 +git config --global credential.helper 'cache --timeout 32400'
 +~~~
 +
 +
 +Pour désactiver credential.helper temporairement
 +~~~bash
 +git -c credential.helper= push
 +~~~
 +
 +Effacer toutes les autorisations du cache (forgetting all cached credentials)
 +~~~bash
 +git credential-cache exit
 +~~~
 +
 +
 +## Méthode netrc (déconseillé)
 +
 +**Méthode à éviter, car le mot de passe est enregistré en clair**
 +
 +`~/.netrc`
 +~~~
 +machine  git.acme.fr
 +login    user
 +password P@ssw0rd
 +~~~
 +
 +~~~bash
 +chmod 600 ~/.netrc
 +~~~
 +
 +Voir `man netrc`
 +Voir aussi `http.extraHeader`
 +
 +
 +ou alors
 +~~~bash
 +git config --global credential.helper store
 +~~~
 +
 +
 +
 +## http.extraHeader
 +
 +Exemples
 +~~~bash
 +git -c http.extraHeader="Authorization: Basic YmQ2MTY0Om82ZzV4YWU1Zm1xZXFkYmphdGRmamljaGRrNTVsd2VxNGp4eXQyanZ3dGp1enhkd3dneGE=" clone https://azuredevops.example.net/Main/MyProj/_git/MyRepo
 + 
 +git config --global http.https://yourdomain/.extraheader "AUTHORIZATION: basic $(echo -n "x-access-token:${{ secrets.BOT_TOKEN }}" | base64)"
 + 
 +git --config-env=http.extraheader=GIT_AUTH_HEADER clone https://dev.azure.com/yourOrgName/yourProjectName/_git/yourRepoName 
 + 
 +git config -l --local
 +~~~
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki