0

for this wonderful community that inspired me to start my learning journey.

My name is Lina and I just started teaching myself about web-development few days ago. I am learning about Git and Github for few days. My basic understanding of Git and Github is that Git is a tool that we use to track the history of our folder or repository at the local machine where Github is a website where we can share our code with other collaborators(remotely).

Here what I did step by step until I stick with the issue:

  1. I created a Github account.
  2. I checked the command line(terminator)if I have git install in my laptop (I am using Mack laptop). Open the command Line: then type (git --version) and here what I got back in the command line
git version 2.26.2
[(base) lealas-MacBook-Pro:~ username$ git --version
git version 2.26.2
(base) lealas-MacBook-Pro:~ username$ git --version
git version 2.26.2
(base) lealas-MacBook-Pro:~ username$ 
  1. I downloaded visual studio code (VSC) on my laptop; then in my local machine created a folder called git. I opened that folder in VSC. When I try to connect VSC with Github through the following step:
  2. open my folder in my local machine (this folder called git).
  3. press view on vsc and click on terminal; then write git clone following by the SHH from github:
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
(base) lealas-MacBook-Pro:git username$ git clone git@github.com:lina-aleean/demo-repo.git
Cloning into 'demo-repo'...
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.
(base) lealas-MacBook-Pro:git username$ 

Please can someone help? I have been trying to solve this issue for more than 7 hours; but I am new in this world of technology and teaching myself from the scratch.

I really appreciate your help. I am watching this video to learn git and GitHub

https://www.youtube.com/watch?v=RGOj5yH7evk

merlin2011
  • 71,677
  • 44
  • 195
  • 329
New Coder
  • 27
  • 3

1 Answers1

0

It looks like you are trying to clone a repo over SSH without having SSH keys. If you want to add SSH keys, you can try to follow the instructions here.

Note that depending on your OS, how you generate and use SSH keys will vary.

Alternatively, if you do not mind typing username and password when pushing, you can use HTTP instead:

git clone https://github.com/lina-aleean/demo-repo.git

merlin2011
  • 71,677
  • 44
  • 195
  • 329
  • Hi merlin2011; Thank you so much for your answer. I tried to copy the SSH key from Github and paste it on VSC, but for some reason did not work. To be honest with you I still do not know what the SHH key means! I followed the link above before, but it didn't work. I may be doing something stupid. I am new in the computer field; only know how to goole and write word document; but I am eager to learn. – New Coder Jun 03 '20 at 00:58
  • @Lina_Alvarez, Did the other approach of cloning with HTTP work? Also, please update your question to describe what you've tried to do with respect to both generating ssh keys and copying them. – merlin2011 Jun 03 '20 at 01:06