1. 安装指定版本
在 VSCode
中打开扩展(Ctrl + Shift + X
),搜索 GitLens
,右键点击 安装特定版本
,在弹出的窗口中选择 17.0.2
,然后等待安装完成。
2. 修改插件文件
找到并进入
VSCode
扩展安装目录:- Ubuntu:
~/.vscode/extensions
- Windows:
C:\Users\用户名\AppData\Roaming\Code\User\extensions
- Mac:
~/.vscode/extensions
- Ubuntu:
找到
GitLens
插件文件夹,修改eamodio.gitlens-17.0.2/dist/webviews/graph.js
文件
以Ubuntu
为例,修改的文件路径为:~/.vscode/extensions/eamodio.gitlens-17.0.2/dist/webviews/graph.js
搜索以下内容:
,W().createElement(ld,{className:"graph-app__gate",featurePreview:eZ,featurePreviewCommandLink:eZ?iT("gitlens.plus.continueFeaturePreview",r.webviewId,r.webviewInstanceId,{feature:eZ.feature}):void 0,appearance:"alert",featureWithArticleIfNeeded:"the Commit Graph",source:{source:"graph",detail:"gate"},state:eU?.state,webroot:r.webroot,visible:!eW},W().createElement("p",{slot:"feature"},W().createElement("a",{href:"https://help.gitkraken.com/gitlens/gitlens-features/#commit-graph-pro"},"Commit Graph"),W().createElement(lr,{source:{source:"graph",detail:"badge"},subscription:eU})," ","— easily visualize your repository and keep track of all work in progress. Use the rich commit search to find a specific commit, message, author, a changed file or files, or even a specific code change."))
找到后,直接删除,然后保存文件即可。
3. 重启 VSCode
- 重启
VSCode
,即可看到GitLens
插件已经破解成功。 - 如果重启后,发现
GitLens
插件仍然显示为需要付费状态,可以尝试重新安装这个版本(17.0.2)的插件,或者重新修改插件文件。 - 破解成功后,记得关闭插件自动更新功能,否则插件会自动更新,破解失效。
- 如果需要关闭插件自动更新功能,可以按照以下步骤操作:
- 关闭
GitLens
插件自动更新:- 打开
VSCode
,找到扩展
(Ctrl + Shift + X
) - 搜索
GitLens
,点击GitLens
,取消勾选自动更新
即可
- 打开
- 关闭所有插件自动更新:
- 打开
VSCode
,点击左下角的齿轮图标,选择设置
- 在设置中搜索
自动更新
,找到扩展
选项,将其设置为无
- 保存设置,关闭
VSCode
,重新打开即可
- 打开
- 关闭
截至发文,亲测有效~