I have a git repository A with contents:
<shared files dir>/
sharedFile1
sharedFile2
And I have additional git repository B with 2 projects, each of them has to use the shared files from repository A. So that the file structure will be similar to this:
Project_X
<shared files dir>/
sharedFile1
sharedFile2
<project X dirs>
Project_Y
<shared files dir>/
sharedFile1
sharedFile2
<project Y dirs>
I would like the shared files to be updated only in the repository A, and I need to allow project_X and Project_Y to get those updates easily.
Actually, symbolic link could be the exact solution I need, but unfortunately, the filesystem I use doesn't support it.
Git subtree also looks as suitable solution, but the problem is that I couldn't find how to merge a subtree from same branch to 2 locations in same repository. I succeeded to create the file structure I need:
git read-tree --prefix=Project_X/shared_files_dir/ -u shared_remote_branch
git read-tree --prefix=Project_Y/shared_files_dir/ -u shared_remote_branch
Creates the required filestructure (exactly as I described at the top of the question), but trying to merge updates brings me the changes only to the last subtree I created:
git merge --squash -s subtree --no-commit shared_remote_branch
Updates only the Project_Y/shared_files_dir/, and not the Project_X/shared_files_dir/ with the changes from shared_remote_branch.
I would appreciate any ideas. On how to merge the subtree from one branch to 2 locations (Project_X/shared_files_dir/) and (Project_Y/shared_files_dir/) or how to make it in any other methodology