- 注意事项
不能使用全局配置用户名和邮箱,即不能带有 --global
git config --global user.name "xxxx"
git config --global user.email "xxxxx.@xxx.com"
- 找到.ssh文件
C:\Users\admin.ssh
然后复制路径,打开
git bash
,然后cd切换到这个.ssh文件夹
- 生成ssh-key
ssh-keygen -t rsa -C "你的邮箱地址"
第一个回车保存文件输入名字便于区分 可以gitee的账号命名id_rsa_gitee
,github账号命名id_rsa_github
,然后继续回车即可
- 将生成的
.pub
文件里的内容复制到gitee/github官网的的设置 -> ssh公钥,确定即可