BGraph Lineage简体中文在 VS Code 里浏览 Git 提交图,查看分支在哪里合并、一次提交改了哪些文件,也可以从一行代码直接找到最后修改它的提交。查看历史和比较文件都在本地完成,离线也能用。 提交图在哪里打开一个 Git 仓库。在默认布局中,编辑器下方的面板里有「终端」和「输出」标签。点击同一排的 Git BGraph 即可查看提交图。如果看不到这个标签,按 查看一次提交改了什么要查 选中一条提交,右侧会列出它改过的文件。双击文件,即可在 VS Code 里对照修改前后的代码。想连续查看几个文件,可以点击「变更文件」旁的眼睛,开启 显示差异预览,然后单击文件逐个查看。这个菜单也可以切换目录树和平铺列表。 需要和同事讨论某处改动时,右键文件,选择 复制文件链接。链接固定到当时的版本,即使分支后来有了新提交,对方看到的仍是同一份代码。支持 GitHub、GitLab、Bitbucket Cloud 和 Gitee。私有项目的访问权限由对应平台管理。 从一行代码追溯改动
在支持函数符号的语言中,还可以点击函数上方的作者姓名,查看当前函数里有多少行代码是每位作者最后修改的。这项功能需要开启 VS Code 的 CodeLens。 EnglishBrowse your Git history in VS Code to see where branches merged and which files changed in a commit. From any committed line of code, you can jump to the commit that last changed it. History and file comparisons run locally and work offline. Where to find the commit graphOpen a Git repository. In the default layout, the panel below the editor has tabs for Terminal and Output. Click Git BGraph in that row to see the commit graph. If you can’t see the tab, press See what changed in a commitTo find changes to Select a commit to see its changed files on the right. Double-click a file to open its diff in VS Code. To review several files in succession, click the eye icon beside Changed files, turn on Show diff preview, then click each file. The same menu lets you switch between a directory tree and a flat list. To share a file as it looked at that commit, right-click it and choose Copy file link. The link points to that revision even after the branch moves on. GitHub, GitLab, Bitbucket Cloud, and Gitee are supported. The hosting service controls access to private repositories. Trace a line of code
In languages that provide function symbols, click the author name above a function to see how many of its current lines each contributor last changed. This requires CodeLens to be enabled in VS Code. |