第一、非常好的github教程
第二、问题
2.1 403 Forbidden
This is the warning: The requested URL returned error: 403 Forbidden while accessing https://github.com
I find this answer:
Github seems only supports ssh way to read&write the repo, although https way also displayed 'Read&Write'.So you need to change your repo config on your PC to ssh way:
- edit
.git/config file under your repo directory
vim .git/config
2.find
3.change it from
url=https://MichaelDrogalis@github.com/derekerdmann/lunch_call.git
to
url=ssh://git@github.com/derekerdmann/lunch_call.git
. that is, change all the texts before
@
symbol to
ssh://git
4.Save
config
file and quit. now you could use
git push origin master
to sync your repo on GitHub
so I tried this command:
git remote rm origin
git remote add origin git@github.com:eduOSS/firstGitpra.git
一般只有第一次远程才会继续出现以下错误,因为publickey只需要设置一次就行了
2.2 Permission denied (publickey)
but only to find this
warning
:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
answer:
I had to add my public key to github.
when I walked through the toturial at the ent of step 2 I occured this:
Could not open a connection to your authentication agent.
so I find the
I should to start the ssh-agent
exec ssh-agent bash
Finally! After finishing the torurial I got it: