@DavidCarlisle but this does not work for me in practice. suppose I added a macro I want to use now everywhere, or added a new package I found useful (fancy header for example)or added a new option to a package I am already using, and want to rebuild my 100,000 latex files with these changes. Now I make the changes in one file only. With your method it means I have to edit 100,000 latex files one by one and copy/add the changes? How could this be better?
Your method is ideal when the tree is very small and has few files, yes. But for a very large source tree, I do not see how to manage what you are suggesting.