George Stoilov
George Stoilov

Reputation: 166

Track git changes in subfolders in VSCode

I have a project that has a root git repository that have multiple subfolders that are also git repositories. My structure is like this:

/Project
/Project/module/libs
/Project/module/src

Every folder has a separate git repository, because libs and src are used from another projects.

In root project I have ignored the others libs and src, but I want them to be tracked from the VSCode (Web Storm does it).

Upvotes: 4

Views: 3236

Answers (2)

Inspecta Tech
Inspecta Tech

Reputation: 21

I'm 2 days new to vsCode (in 2021) and had the same problem during setup. I closed the Parent Workspace that was ignoring the nested repos and created a new workspace of the nested repos. VsCode started showing the changes like it did with the parent. Then I saved the workspace and added the parent repo to the new repo with the nested repos and everything is now being tracked and displayed.

Upvotes: 2

VonC
VonC

Reputation: 1326554

You should try and clone the main project elsewhere, then try and add the Git repos libs and src as submodule (assuming that those repos are already pushed somewhere)

cd /path/to/Project
git submodule add /url/repo/libs module/libs
git submodule add /url/repo/src module/src

Then you can open Project in VSCode: it should track as well libs and src.

VSCode is still developing its Git submodule support, starting with PR 36313.

Upvotes: 0

Related Questions