ssh -keygen -t rsa -C "haojinglong4202@163.com"
注意ssh-keygen命令中间没有空格,如果在ssh后面加上空格,会得到Bad escape character 'ygen'.的错误。
cd ~/.ssh
id_rsa.pub 为KEY
ssh -T git@github.com 验证
git clone git@192.30.252.128:xuanya4202/Haomalloc.git
hao8xxxxxx
git add . 添加目录全部文件
git commit -m 'addcode'
git push origin master
git init
git add ./
git commit -m "first commit"
git remote add origin git@...
git push -u origin master
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/
解决方案:
vim .git/config
修改
url = https://github.com/wangz/example.git
为:
url = https://wangz@github.com/wangz/example.git