sourcetree 黑科技

发布时间 2023-04-11 16:37:12作者: 湛蓝v天空

转自:https://it.cha138.com/php/show-47743.html
哪里有压迫,哪里就有反抗。于是就出现了许多绕过 Sourcetree 登录注册的黑科技,这里记录其中的一种,也分享给大家。

Windows 版本
安装 Sourcetree 最新版本,打开运行,提示登录注册,直接关掉应用。打开文件资源管理器,地址栏输入:

%LocalAppData%\Atlassian\SourceTree\

回车打开 Sourcetree 应用目录,新建一个名为 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

]
有了这个文件,再次打开 Sourcetree 就可以跳过登录注册环节,直接使用了。

MacOS 版本
Mac 版本操作更简单,直接打开 Sourcetree 运行一次,再关闭,打开终端命令行工具,输入命令:

defaults write com.torusknot.SourceTreeNotMAS completedWelcomeWizardVersion 3
执行即可。