跳到主要内容

git客户端生成ssh-key密钥


id: git-client-generates-ssh-key-keys title: git客户端生成ssh-key密钥 keywords:

  • git
  • ssh description: git客户端生成ssh-key密钥 last_update: date: 2022-11-03 author: litttley tags: ["git","ssh"]

设置git账号

cmd执行(如果之前设置过可以跳过)

git config --global user.name 'xxxx'
git config --global user.email 'xxxx@qq.com'

生成ssh key

ssh-keygen -t rsa -C '上面设置的邮箱'

然后回车三生成

最后在c盘用户下C:\Users\litttley.ssh目录下得到了两个文件:id_rsa(私有秘钥)和id_rsa.pub(公有密钥)

添加仓库公钥

githubgiteer 或其他远程代码库中添加id_rsa.pub内的公钥内容就行