添加公钥
1、打开git bash here
![](https://img.haomeiwen.com/i7197012/1bcce925ceaf10ca.png)
2、执行 ssh-keygen -t rsa -C "输入你的邮箱地址"然后三次回车
3、执行 cat ~/.ssh/id_rsa.pub 查看你的公钥,如下,并把这段复制下来:
![](https://img.haomeiwen.com/i7197012/cbefcd4e7804bdfd.png)
4、打开码云 找到:
![](https://img.haomeiwen.com/i7197012/0664bcda71091381.png)
添加至:
![](https://img.haomeiwen.com/i7197012/d99f07a93c5cabb2.png)
5、输入 ssh -T git@gitee.com,系统会提示你输入yes/no,输入yes,如果出现:You've successfully authenticated, but GitHub does not provide shell access.就表示成功了。
6、配置用户名密码
git config --global user.name "你的gitee账号"
git config --global user.email "你在gitee的邮箱地址"
设置完以上这些之后,再试试git push是否还需要提交账号密码
网友评论