在将本地代码推送到远程仓库时,为了减少手动输入用户名和密码,采用SSH秘钥进行验证,操作步骤如下:

1. 检测用户名和邮箱是否配置:

git config --global user.name "your name"

git config --global user.email "your email"

2.输入命令 :ssh -****** -t rsa -C "your email", 并按回城3下,生成公钥和私钥,一般是在C:\Users\Administrator目录下。

通过执行查看公钥的命令cat ~/.ssh/id_rsa.pub,或通过notepad++查看。

3.在个人github账户中点击Settings选项,然后找到SSH and GPG keys选项,并点击New SSH Key:

git SSH配置

最后将公钥(id_rsa.pub)的ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABg... 内容复制粘贴到指定位置,如下图:

git SSH配置

 

相关文章:

  • 2021-06-28
  • 2021-12-11
  • 2021-09-12
  • 2021-04-02
  • 2022-01-01
  • 2022-02-17
  • 2021-06-01
猜你喜欢
  • 2021-07-25
  • 2021-09-15
  • 2021-05-22
  • 2021-07-01
  • 2022-12-23
相关资源
相似解决方案