17 mai 2022

Basculer des URL de dépôts distants Github de HTTPS vers SSH

Documentation Github

Si la commande git push est requiert les identifiants.

cd /mon/projet/sur/github

Pour lister les dépôts distants :

git remote -v
# origin  https://github.com/OWNER/REPOSITORY.git (fetch)
# origin  https://github.com/OWNER/REPOSITORY.git (push)

Pour changer l’url des dépôts de https vers SSH

git remote set-url origin git@github.com:OWNER/REPOSITORY.git

vérification

git remote -v
# Verify new remote URL
# origin  git@github.com:OWNER/REPOSITORY.git (fetch)
# origin  git@github.com:OWNER/REPOSITORY.git (push)