5

This my project structure in a nutshell:

 + A
 | + some content
 |
 + B
   + A

I want in my main git repo a submodule in B that points to A. But since the A project contains the main method, I want to be able to quickly test before committing, so I'd like a symlink (or rather a mklink since I'm on windows) that points to A so it gets updated without committing.

Vinz243
  • 9,654
  • 10
  • 42
  • 86

1 Answers1

1

The problem is that A doesn't have just "some content".
It also has a .git subfolder in it, which a submodule does not.

If you can, use git worktree in order to checkout a branch in a separate folder (than the original A cloned folder)

Then you can try and use a symlink from B subfolder to A, after adding A as a submodule in B.
Note: since Windows 10 build 14972 (Dec. 2016), symlinks (mklink) can be created without needing to elevate the console as administrator.


A better approach is described in "Git: Possible to use same submodule working copy by multiple projects?".

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250