We are trying to have two git repos in one root directory (to handle modules inside ie. subdirectories).
We cant use git subtree, mainly because there are files in separate subdirectories that need to be in different folders.
We decided to create 2 repos and in the .git/info/exclude file, list the subfolders we wanted ignored for one repo and vice versa. We tried to use the following exclude file for the one that only needs a few folders followed:
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
*
!assets/apps/contratos/*
!api/controllers/contrato/*
!api/models/contrato/*
!api/services/contrato/*
As it is it basically ends up tracking no files, if we remove the * from the file, all files are added again.
We would like git to ignore all folders BUT the ones listed above.
NOTE: Due to our double git structure .gitignore is out of the picture -unless somebody helps with a way to create two .gitignore in the same root directory for 2 different repos.