發(fā)現(xiàn)問題:已經有了公鑰,但是執(zhí)行?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 exist
發(fā)現(xiàn)還是公鑰的問題,按照論壇的解決辦法:
那么問題大概率就定位在了你本機的這個git倉庫并沒有和這個SSH key 關聯(lián)上。
ssh-add "你的 id-rsa 文件地址"
注意這里ssh-add后面填的是私鑰地址,如mac電腦是 /Users/用戶名/.ssh/id_rsa
add之后可以用
$ ssh git@github.com
驗證是不是添加成功。
**************************************************
還是沒有成功。
無奈,重新配置公鑰。https://gitee.com/help/articles/4181#article-header0
完成后,新建一個倉庫,只取名字,然后按步驟執(zhí)行
已有項目,執(zhí)行
cd existing_git_repogit remote add origin?git@gitee.com:a_crystal/test.
gitgit push -u origin master
注意 git status 狀態(tài)為
nothing tocommit, workingdirectoryclean
不是則需要git add.?
git commit -m 'xxx'
保證狀態(tài)
執(zhí)行gitgit push -u origin master 完畢