VS 代码中的 Git 子模块意识不起作用

标签 git visual-studio-code

使用版本 1.22.2。根据release notes from VS Code 1.2 ,应该了解 Git 子模块。但是,我似乎无法使用此功能:

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

最佳答案

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.

我怀疑“子模块更改”只是记录在父 repo 索引中的顶级树 SHA1(gitlink),而不是该子模块中的文件。

gitlink 是发行说明中图片中显示的差异:

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

关于VS 代码中的 Git 子模块意识不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50167478/

相关文章:

go - 调试需要专用终端的golang程序

java - 在我的 Java 文件 (Eclipse) 中引用一个 git 存储库

git - repo 工具无法根据标签 pull

git svn - 我可以同时使用 git 和 svn 吗? git 和 svn 之间不需要交互

python - "pylint (import error)"在与 VSCode 相同的文件夹中导入模块时

typescript - 在 vue 组件的模板 html 中启用智能感知需要什么?

visual-studio-code - Visual Studio代码中的div颜色

git - 识别 merge 到master

git - 获取临时添加的 Remote 的 "git log --tags"

python - 为什么我无法从 vscode python 中的 .env 文件访问我的环境变量?