一:下载ResourTree
下载SourceTree:官网链接
二:注册登录ResourTree
免密登录:在目录C:\Users\AppData\Local\Atlassian\SourceTree 下创建文件accounts.json ,打开该文件并写入以下内容:
[
{
"$id": "1",
"$type": "SourceTree.Api.Host.Identity.Model.IdentityAccount, SourceTree.Api.Host.Identity",
"Authenticate": true,
"HostInstance": {
"$id": "2",
"$type": "SourceTree.Host.Atlassianaccount.AtlassianAccountInstance, SourceTree.Host.AtlassianAccount",
"Host": {
"$id": "3",
"$type": "SourceTree.Host.Atlassianaccount.AtlassianAccountHost, SourceTree.Host.AtlassianAccount",
"Id": "atlassian account"
},
"BaseUrl": "https://id.atlassian.com/"
},
"Credentials": {
"$id": "4",
"$type": "SourceTree.Model.BasicAuthCredentials, SourceTree.Api.Account",
"Username": "username@email.com"
},
"IsDefault": false
}
]
三:配置SourceTree环境
1.生成SSH密钥
运行cmd命令:ssh-keygen -t rsa
敲几个回车执行结束,文件存放位置如下图所示
2.设置ResourceTree的SSH客户端
打开ResourceTree界面——工具——选项——一般:
SSH密钥:选择id_isa文件
SSH客户端:选择OpenSSH
如图所示:
3.配置GitHub中的SSH Key
将上面文件夹中的id_rsa.pub中的内容粘贴到key的输入框中,然后点击Add SSH key
打开SourceTree——Clone——填写GitHub中仓库的SSH地址拉取到本地
结束!