百度經驗上的文章,親測過,好使,如果鏈接能順利打開,就不用看以下內容https://jingyan.baidu.com/article/4f34706e6e4985e386b56d79.html
1.下載並執行SourceTreeSetup-3.1.3.exe,會進入登錄或註冊bitbucket的界面,先別急着操作,繼續往下看。
2.關閉上述安裝窗口,打開 %LocalAppData%\Atlassian目錄(win+r打開命令模式,把%LocalAppData%\Atlassian放到輸入框,回車即可),接着進入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
}
]
3.打開 %LocalAppData%\Atlassian,進入“SourceTree.exe_Url_iayhtc13zv3obzuz5vchezjs1az2q5ef”(注該目錄可能和版本相關,不同版本的路徑可能不完全一樣。)
接着進入"3.1.3.3158"目錄,打開user.config文件,在裏面加入六行代碼。
<setting name="AgreedToEULA" serializeAs="String">
<value>True</value>
</setting>
<setting name="AgreedToEULAVersion" serializeAs="String">
<value>20160201</value>
</setting>
4.再次執行SourceTreeSetup-3.1.3.exe,此處可能會出現如下二種情況,
情況一就進入下一步安裝。
情況二:彈出Mercurial詢問窗口,可以根據實際情況做相應的選擇,比如使用默認選項下載Mercurial,或者使用第四個選項“我不想使用Mercurial”。直接用第一個選項即可!