shawntz / eeb-c177-w20

lab section materials for eeb c177/c234 @ucla (winter 2020) 🐻
https://shawnschwartz.com/eeb-c177-w20/
Other
23 stars 1 forks source link

New Repository help #56

Closed soniavsd closed 4 years ago

soniavsd commented 4 years ago

I am trying to create a new repository and followed all the steps on GitHub, but whenever I enter git push -u origin master, i get: 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.

shawntz commented 4 years ago

@soniavsd can you please post exactly what you're typing into the terminal that results in this error?

soniavsd commented 4 years ago

@ShawnTylerSchwartz sure, i typed this: git init git add -A git commit -m "forgotwhatiputhere" git remote add origin https://github.com/soniavsd/eeb-c177-project.git git push -u origin master

shawntz commented 4 years ago

@soniavsd what happens if you try git push origin master without the -u?

soniavsd commented 4 years ago

@ShawnTylerSchwartz it states: fatal: could not read from remote repository Please make sure you have the correct access rights and the repository exists.

It also states that the remote origin already exists after I do the remote add origin

shawntz commented 4 years ago

@soniavsd what happens if you run the command git remote -v?

soniavsd commented 4 years ago

@ShawnTylerSchwartz i got: origin git@github.com:soniavsd/eeb-c177-project (fetch) origin git@github.com:soniavsd/eeb-c177-project (push)

...i dont know what this means...

shawntz commented 4 years ago

@soniavsd hmm that’s strange because that looks fine to me. Can you instead just create the repository on GitHub and clone it like we did in the very beginning of the course (to work around these issues now)?

soniavsd commented 4 years ago

@ShawnTylerSchwartz I tried to clone it after we talked and it didn't work. I did some more google research and typed in my new error line and got this: A "Permission denied" error means that the server rejected your connection. There could be several reasons why, and the most common examples are explained below.

And my push finally worked after I changed the remote url in the terminal! Still a bit confused of what was wrong with it initially...but as long as it works! Thank you for the help!

shawntz commented 4 years ago

@soniavsd okay great! Glad you were able to troubleshoot and solve it!