0

I was working with git to commit my files and folder to new repository. Everyone time when I was pushing my code it asked for username and password (which is github token for me). To avoid this I read solution on Configuring user and password with Git Bash given by @manojlds.

So I ran this command: git remote set-url origin git+ssh://git@github.com/username/reponame.git after reading it.

Now when I am pushing my code it neither the problem is solved nor it is giving me option to enter username and password(token)

After doing $ git push it is showing this

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.

What should I do to revert it back and so that at least I can enter username and password(token) and upload my files and folder.

Liam
  • 25,247
  • 27
  • 110
  • 174
rajkumawat
  • 11
  • 3

1 Answers1

1

From August 13, 2021, no longer accepts Password-based authentication. Github provides a more secure alternative to it and ie. PATs(Personal Access Tokens).

How to generate personal access token

If you have done this properly, You can also refer this

GitHub Error Message - Permission denied (publickey)