首先呢,我已經弄好了ssh的密鑰,ssh -T git@githun.com是可以的,回傳:
Hi xxxxxx! You've successfully authenticated, but GitHub does not provide shell access.
但是,當我想要git push的時候,總是失敗,提示是:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
FATAL Something's wrong. Maybe you can find the solution here: xxxxxxxxxxxx
請問這是什麼情況,
我執行的是
git remote add origin git@github.com:xxxxxxx/test.git
git push -u origin master
設定Git的user name和email
產生SSH密鑰
新增金鑰到ssh:ssh-add 檔案名稱,需要之前輸入密碼.
在github上加入ssh金鑰,這要加入的是「id_rsa.pub」裡面的公鑰。
開啟https://github.com/,在設定中加入金鑰