本地生成 ssh key

1. 配置Git用户名和邮箱

  git config user.name "用户名"

  git config user.email "邮箱"

2. 生成ssh key

    ssh-keygen -t rsa -C "邮箱"

如果报  fatal: not in a git directory, 是因为没有将当前目录作为git目录。

先执行命令 git init 。在执行上面的

如果使用的是GitLab, 将 生成的id_rsa 复制到 settings 的ssh 中就可因了

 

猜你喜欢

转载自www.cnblogs.com/lvsk/p/12579398.html