工作中遇到部分同事不习惯用Git命令行方式进行代码管理,就试着帮忙安装SourceTree。安装过程中发现SourceTree 3.3.8版本跳过注册步骤有些特殊,这里做下记录。


1、双击“SourceTreeSetup-3.3.8.exe”运行SourceTree安装程序,稍后可以看到安装程序直接跳到注册登陆界面,如下图:

install.png


2、关闭安装程序,打开Windows资源管理器在地址栏输入:%LocalAppData%\Atlassian\ 按回车键,转到SourceTree安装目录。

20200429184116.png

3、在SourceTree目录下创建accounts.json文件

#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": "",
      "Email": null
    },
    "IsDefault": false
  }
]


4、在SourceTree.exe_Url_clbecxc3xgbdmkfbnskxiuxqslvhuo5z\3.3.8.3848\user.config文件</SourceTree.Properties.Settings>节点前添加下述内容:(注:红色字符串是根据系统环境随机生成的,请根据实际情况进入到指定目录操作)

#user.config

            <setting name="AgreedToEULA" serializeAs="String">
                <value>True</value>
            </setting>
            <setting name="AgreedToEULAVersion" serializeAs="String">
                <value>20160201</value>
            </setting>


5、再次双击“SourceTreeSetup-3.3.8.exe”运行SourceTree安装程序,即可跳过注册步骤完成安装操作。