0

I have multiple projects (repositories) which use the same submodules. Every projects submodule is displayed in the vs-code source control "overview".

Screenshot of source control overview I want just one submodule in this overview so that I can make changes to the one sumodule, which apply to every project.

I tried to hide the respositories I don't want to see but then the problem is that when I change one submodule I have to pull for every single project again the submodule, which is not ideal.

starball
  • 20,030
  • 7
  • 43
  • 238
tmol
  • 1
  • 1
  • 1
    Welcome! As instructed in [ask], can you please write a descriptive, non-ambiguous title? For more guidance, see [How do I write a good title?](//meta.stackexchange.com/q/10647/997587) – starball May 08 '23 at 00:54

1 Answers1

1

If each project has the same upstream as a submodule, they're still separate submodules, and a modification you make to one submodule does not automatically carry over to others, so they really are different, and I think it would be more harm than good to mysteriously only show one of them in the VS Code SCM Outline.

What I think you can do with your problem and setup is to just use submodules that point to a common local checkout. Try cloning that common repo somewhere onto your filesystem, and then adding submodules that point to it or its .git directory. Ex. If your current working directory is the directory of repo A, and you clone the common repo as a sibling directory of A, then do git submodule add ../<common-repo-directory-name>/.git. If you get an error like "fatal: transport 'file' not allowed", then try doing -c protocol.file.allow=always.

Related: Nested git repositories without remotes (a.k.a. git submodule without remotes).

starball
  • 20,030
  • 7
  • 43
  • 238