文章目錄
- 1. 安裝指定版本
- 2. 修改插件文件
- 3. 重啟 VSCode
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
,重新打開即可
- 打開
- 關閉
截至發文,親測有效~