travis5567
travis5567

Reputation: 23

Issue trying to push to git repository

Problem when pushing app to github. This is what I entered into the command line. Hopefully it's just a small problem I can fix thanks.

git init
git add README.md
git commit -m "first commit"
git remote add origin [email protected]:travi5567/first_app.git
git push -u origin master

This is the error I get:

Traviss-MacBook-Pro:sample_app Travis$ git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Upvotes: 1

Views: 286

Answers (2)

Ian Stapleton Cordasco
Ian Stapleton Cordasco

Reputation: 28747

If you don't know how to use SSH keys or would rather not you can also use the https remote like so:

git remote add origin https://[email protected]/travis5567/first_app.git
git push origin master
Password for travis5567: <enter your password>
# regular output from a git push

Upvotes: 2

Haegin
Haegin

Reputation: 530

GitHub uses SSH keys to configure access to git repositories. If you are the owner you can push to the repo but you need to tell git your SSH key so they know who you are first.

It's all explained on the GitHub website - https://help.github.com/articles/generating-ssh-keys

Upvotes: 2

Related Questions