I have followed these instructions below to upload a project.
Global setup:
Download and install Git
git config --global user.name \"Your Name\"
In my case, I had to setup the public key for another user, as I already had one for my main user. once I switched users and performed the commands in the link above I was able to perform the setup for my test server without a problem.
after you created the RSA key pair, you must to add it to SSH using:
ssh-add ~/.ssh/id_rsa
or wherever you created your rsa key pair.
I had this problem, but none of the solutions above worked. I could clone and fetch but couldn't push. Eventually, I figured out the problem was in the url
in my .git/config
, it should be:
git@github.com:<username>/<project>
(not ssh://github.com/<username>/<project>.git
or https://github.com/<username>/<project>.git
).
A good one if you have installed git on your computer:
http://help.github.com/mac-set-up-git/
You can try change your type connection to branch from ssh to https.
nano project_path/.git/config
git@github.com:username/repository.git
to https://username@github.com/username/repository_name.git
ctrl
+ o
After that you can try git pull
without publickey