0

I've a project structure like this in a git repo:

/Code
    /admin
    /api
/DB
/Docs-Files
/UI-UX

I want to clone /admin and /api onto my server www directory and keep it in sync with git, so that the structure on server becomes:

/www
    /admin
    /api

So is it possible to clone like that? I checked out this answer and was able to clone /Code/admin and /Code/api under www.

Community
  • 1
  • 1
Kanav
  • 2,695
  • 8
  • 34
  • 56

1 Answers1

0

Instead of depending directly on GIT, you could use symlinks. I am assuming that you already have the sparse-checkout done correctly, so could just do:

On *nix

ln -s /Code/admin /www/admin
ln -s /Code/api /www/api

On Windows

(obviously, looking at the paths, I don't think you are using Windows, but for the sake of completeness)

mklink /J /www/admin /Code/admin
mklink /J /www/api /Code/api

(Note that the args in ln and mklink are in the opposite order. In the former the source is the first arg whereas it is the second one in the latter.)

Then you would just do you Git-y work in the original /Code directory.

Ashutosh Jindal
  • 18,501
  • 4
  • 62
  • 91