Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Git Basics Working With Remote Repositories GitHub

Rizwan Ahmed
Rizwan Ahmed
6,578 Points

Hi , getting this error message while trying to connect remote repository

I have already added the remote origin $ git remote add origin git@github.com:Rizwan-Ahmed-Surhio/my_really_cool_project.git

Error:

Rizwan@Rizwan-PC MINGW64 ~/github/my_really_cool_project (master) $ git push -u origin master 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.

Rizwan@Rizwan-PC MINGW64 ~/github/my_really_cool_project (master) $

2 Answers

Andrey Misikhin
Andrey Misikhin
16,529 Points

You are using open or private repository on GitHub?

Rizwan Ahmed
Rizwan Ahmed
6,578 Points

Thanks Andrey for your reply, No I am not using private repository, I don't know what does open repository mean.

Andrey Misikhin
Andrey Misikhin
16,529 Points

You must do this steps in console from your project folder:

  1. git init
  2. git add <your file>
  3. git commit -m "first commit"
  4. git remote add origin https://github.com/<your github nick>/<your repo>.git
  5. git push -u origin master

I checked this GitHub instruction on my public repository and it works well.

Rizwan Ahmed
Rizwan Ahmed
6,578 Points

Sure, I will give it a try, Many thanks for your help.