2

Say we are using git submodule:

git submodule add https://github.com/user/repo

I am wondering if there is a way to tracker a specific folder, something like this:

git submodule add https://github.com/user/repo -- xxx

is something like this possible?

For example, say we we have this in our .gitmodules file:

[submodule "config"]
    path = config
    url = https://github.com/user/repo.git

so what I am looking for is the config folder in my local project to reflect the xxx folder in the other/remote repo.

Alexander Mills
  • 90,741
  • 139
  • 482
  • 817

1 Answers1

1

is something like this possible?

Not that I know of.

One way would be to:

  • add the submodule in one folder

    git submodule add https://url/repo afolder
    
  • record a symlink to the right submodule subfolder

    ln -s afolder/xxx xxx
    git add xxx
    
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250