Issue
I am no longer able to connect to my github respository account using my personal laptop.
It gives below error:
$ git push -u origin main
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I checked my ssh config. Tried adding my public key to github - it says keys are already in use.
May be I messed up my git-local by trying something new for azure authentication because when I ran git config --list, following 2 lines seems to be suspicious as why credential has to be azure something as I am not using any azure authentication. I am not using any VPN or Proxy as its my personal laptop. How do I correct the setting to make it normal as when it's setup. Or where else can be the problem? What should I check?
credential.helper=manager-core
credential.https://dev.azure.com.usehttppath=true
Full config listing is below:
$ git config --list
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
pull.rebase=false
credential.helper=manager-core
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master
user.name=My name
[email protected]
core.longpaths=true
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
alias.st=status
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
[email protected]:myusername/myAppApp.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
Solution
Though I don't understand what was wrong. May be my local ssh key got corrupted or updated by mistake.
What worked is:
- Delete old ssh key in my laptop.
- Generate new key.
- Configure that in Github
Answered By - nanosoft Answer Checked By - Pedro (WPSolving Volunteer)