sourcetree生成ssh管理github

1. Sourcetree主界面上,选择命令行模式

2. 在命令模式执行如下命令:

$ git config --global user.name "xxx"
$ git config --global user.email "xxx.mail@xxx.com"
$ ssh-keygen -t rsa -C “xxx.mail@xxx.com”
# 按3个回车,密码为空。

文件存放位置 ~/.ssh,如果是window的话就在:C:\Users\Administrator.ssh 下面

3. 配置SourceTree 的 SSH,工具 ->  选项 ->  一般:

(1)ssh密钥输入:C:\Users\Administrator\.ssh\id_rsa

(2)ssh客户端选择:openssh

4. 登录github,访问项目地址,Setting -> Deploy keys -> Add Deploy key,用记事本打开 C:\Users\Administrator\.ssh\id_rsa.pub,粘贴确定即可。

原文地址:https://www.cnblogs.com/saturn/p/2657295.html