首页 > 解决方案 > VS Code 中的 Git 子模块意识不工作

问题描述

使用版本 1.22.2。根据VS Code 1.2 的发行说明,应该了解 Git 子模块。但是,我似乎无法使用此功能:

  1. 打开一个包含 git 项目的文件夹,该项目又包含子模块
  2. 在其中一个子模块中进行更改
  3. 观察到源代码控制视图仅说明主存储库中更改的子模块对象

标签: gitvisual-studio-code

解决方案


There is basic support in place which lets you stage, unstage or discard submodule changes in the outer repository. You can disable automatic submodule detection with the git.detectSubmodules setting.

I suspect "submodule changes" are only the top tree SHA1 (the gitlink) recorded in the parent repo index, not the files within that submodule.

The gitlink is the diff shown in the picture seen in the release notes:

https://code.visualstudio.com/assets/updates/1_20/submodules.png


推荐阅读