一、去sourceTree官網下載最新的包
官網:https://www.sourcetreeapp.com/
windows版下載地址:https://product-downloads.atlassian.com/software/sourcetree/windows/ga/SourceTreeSetup-3.2.6.exe?_ga=2.240708419.1383101182.1574670384-200523786.1574670384
二、執行下載的exe包
接着下載並執行SourceTreeSetup-3.2.6.exe,會進入登錄或註冊bitbucket的界面,我只是想用軟件,並不想去註冊賬號。
到了註冊頁面後關閉頁面。
三、配置賬號信息
關閉上述安裝窗口後,打開 %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 } ]
用戶配置:
打開 %LocalAppData%\Atlassian,進入"SourceTree.exe_Url_nn1m0zxifrz542zaokz0zdglt1dyzdcn\3.2.6.3544"
打開user.config文件,在裏面加入六行代碼。
<setting name="GitWhichOne" serializeAs="String"> <value>1</value> </setting> <setting name="AgreedToEULA" serializeAs="String"> <value>True</value> </setting>
四、再次執行exe包
再次執行SourceTreeSetup-3.1.3.exe,彈出Mercurial詢問窗口,可以根據實際情況做相應的選擇,比如使用默認選項下載Mercurial,或者使用第四個選項“我不想使用Mercurial”。