添加公钥
1、打开git bash here

2、执行 ssh-keygen -t rsa -C "输入你的邮箱地址"然后三次回车
3、执行 cat ~/.ssh/id_rsa.pub 查看你的公钥,如下,并把这段复制下来:

4、打开码云 找到:

添加至:

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是否还需要提交账号密码
网友评论