1

I'm new to git and anytime i try to push to my repository using "git push origin master", i get this error

[email protected]: Permission denied (publickey). fatal: Could not read from remote repository.

i believe i must have incorrectly entered my git credentials (username or password) and the system have saved the incorrect credentials. Please how do I delete the already stored credentials so that i can be prompted to enter again my credentials when i want to push to my repository. i use Linus OS.

Thank you.

3

2 Answers 2

1

When using git over ssh, you need a public/private key pair.

  • If you already have setup a public/private key pair, it would probably be located in ~/.ssh/id_rsa.pub.
  • If you don't have that setup with GitHub, you should set that up

Alternativly, you can just push to the GitHub repository with HTTPS and your GitHub login, by doing

git remote set-url --push https://github.com/<username>/<repository>.git 

and pushing the repository.

Sign up to request clarification or add additional context in comments.

Comments

0

(first create a repository in git, if not created already)

This worked for me:

Step 1- git remote rm origin

Step 2-select the http option in github

step 3- run the following command again

git remote add origin https://github.com/yourdirectory/link.git

git branch -M main

git push -u origin main

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.