« Books | Main | Leyland Kirby »
Saturday
Apr232022

Git Push asks for Password instead of using SSH Key

One recurring minor annoyance with git is that if you create a new local respository using git clone then it defaults to always asking for a password when you do git push instead of using a pre-existing SSH key. If you are pushing to Github then the push will fail because Github recently started blocking password-based access on security grounds.

To get it to use the SSH key you need to open .git/config in an editor and change the [remote "origin"] url so it starts ssh:// instead of https;//.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.