环境

  • 操作系统:Windows 10
  • SourceTree版本:3.2.6
  • Git版本:2.32.0

操作

使用SourceTree,首先要安装好Git Git下载:Git官方下载 SourceTree3.2.6下载:https://www.aliyundrive.com/s/YaPUrifE6Ta

git生成ssh密钥

ssh-keygen -t rsa -b 2048 -C "gitlab中账户的邮箱地址"

安装Sourcetree

  1. 双击下载好的SourceTreeSetup-3.2.6.exe文件,弹出安装窗口之后,将其关闭
  2. 同时按键盘:windows+r,调出运行框,输入:%LocalAppData%\Atlassian\SourceTree\
  3. 新建文件:accounts.json

accounts.json文件内容为以下内容,全部复制进去,Ctrl+S保存

[
{
"$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": "",
"Email": null
},
"IsDefault": false
}
]
  1. 再次同时按键盘:windows+r,调出运行框,输入:%LocalAppData%\Atlassian\

进入-3.2.6.3544,找到user.config文件,右键-编辑(选择打开方式-记事本)在最下面添加以下内容,添加到 </SourceTree.Properties.Settings> 这个标签内

<setting name="AgreedToEULAVersion" serializeAs="String">
<value>20160201</value>
</setting>
  1. 再次双击SourceTreeSetup-3.2.6.exe文件,弹出窗口,选择-我不想使用Mercurial