4

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,060
  • 10
  • 40
  • 79

1 Answers1

0

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,129,465
  • 480
  • 4,036
  • 4,755