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

Written by James McDonald

June 21, 2024

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
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 (fetch)
origin (push)

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


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.

You May Also Like…