Sourcetree是我最喜歡的一款git客戶端工具了。最近在windows上安裝時發(fā)現(xiàn)安裝的時候一定要先登錄,但Atlassian的賬號登陸又是要翻墻的,給不方便翻墻的同學(xué)帶來不便。
通過比較安裝成功和安裝到一半的文件差別,發(fā)現(xiàn)在
%LocalAppData%\Atlassian\SourceTree\ 文件下多了一個配置文件
accounts.json ,應(yīng)該是做了個本地的緩存,那么如果我現(xiàn)有這個本地配置文件是否能跳過遠(yuǎn)程登陸呢,嘗試了一下是可以的。
所以在不翻墻安裝windows版Sourcetree的解決方案如下:
先嘗試安裝一次,到登陸界面再退出。
進(jìn)入
%LocalAppData%\Atlassian\SourceTree\目錄下創(chuàng)建accounts.json文件。重新進(jìn)行安裝
文件內(nèi)容如下:
[
{
"$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
}
]