Fatal: Could not read from remote repository Please make sure you have the correct access rights and the repository exists

I have changed my username from that day i am not able to clone my repository to local machine i am getting below error .

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

This tells me the remote has an SSH URL. So the authentication error means that either you don’t have an SSH key available on the machine (possibly not loaded into SSH agent), or the key you have hasn’t been added to your GitHub account.

@airtower-luna i have push so many times to my repo this problem has started when i changed my username .what should i do now ?can you please elaborate

In general: Check your SSH key is available on your computer, and added to your account.

If it started when you changed your username, there’s another possible problem: If the repository is one you own, the username is part of the URL. So you’ll need to update that.

You can check the current URL with (assuming your remote is named origin):

git remote show origin

And if necessary change it with:

git remote set-url origin <newurl>

See also: Git - git-remote Documentation

let me add ssh key first on github account

@airtower-luna i have added SSH Key on my Account still i am getting error but this time something has changed

D:\SparkWeb>git clone https://github.com/VedpathakYogesh/Spark.git
Cloning into ‘Spark’…
Enter passphrase for key ‘/c/Users/yogesh.vedpathak/.ssh/id_ed25519’:
Enter passphrase for key ‘/c/Users/yogesh.vedpathak/.ssh/id_ed25519’:
Enter passphrase for key ‘/c/Users/yogesh.vedpathak/.ssh/id_ed25519’:
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

@airtower-luna This Issue has been resolved by adding proper SSH key

ssh-keygen -t rsa-b 4096 -C “example@gmail.com

Looks like SSH is asking for the key passphrase three times, which makes me wonder if the passphrase you’re entering is wrong. Mind that this is the passphrase for your SSH key, not your GitHub password or a PAT.

For more debug info on the SSH connection itself, try:

ssh -vT git@github.com