0

the usual way that I create my git repos, is on the website, and then clone them. I wanted to try the other way around, calling git init in my command line.

So I create a repo with nothing in it, and get these steps shown to me:

echo "# malware" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:S3j5b0/malware.git
git push -u origin main

Great, I follow these instructions exactly in my command line, and in the last line, I get:

ask@garser:~/Git/malwa$ git push -u origin main
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 is happening?

GarseB010
  • 27
  • 5

1 Answers1

-1

Did you setup your git user name and email? Try with

git config --global user.name "Mona Lisa"
git config --global user.email "monalisa@gmail.com"

Please make sure that your username has access to the project repo!

If this didn't work then edit your remote origin with the HTTPS Url using

git remote set-url origin YOUR_HTTPS_URL

You can find the URL in your repo as below.

enter image description here

Santosh
  • 2,093
  • 1
  • 15
  • 21