Stop being prompted for ssh passphrase when trying to sync repo with github in VS Code

The Problem: You have cloned…

Login

Blog History

The Problem: You have cloned your repo with the SSH URL. Whenever you go to push to GitHub. You might be asked to enter a passphrase repeatedly for your SSH key...

Before Fix

git remote -v 
origin  [email protected]:toggenation/cakephp-live-test-sxs.git (fetch)
origin  [email protected]:toggenation/cakephp-live-test-sxs.git (push)

This is on Windows 11, WSL2 Ubuntu 24.04 and trying to push to a GitHub repo

To fix switch switch to https and use the VSCode sign-in to GitHub and VS Code will auto authenticate

Get the https URL from the repo.

Make sure you are signed-in to GitHub with VSCode

Remove the old git@github URLS, add the https:// url

git remote remove origin
git remote add origin https://github.com/toggenation/cakephp-live-test-sxs.git
git branch --set-upstream-to=origin/main
git pull

What the output of git remote -v look like after the above

git remote -v
origin  https://github.com/toggenation/cakephp-live-test-sxs.git (fetch)
origin  https://github.com/toggenation/cakephp-live-test-sxs.git (push)

You can now successfully push from VS Code to GitHub without continual passphrase prompts

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.