I have been around Github for a while now mainly just downloading libraries that others made.
Now, for the first time, I’m using it to manage my own repo. And I have run into the following problem:
In my repo, I have folders A, B, and C. In each of those folders, there is a /scripts/ subfolder, containing some code. These 3 /scripts/ folders and their contents are identical. And they should stay that way.
So, what I want to accomplish is that when I change something in /A/scripts/somecode.cs, the /B/scripts/somecode.cs also gets updated with the latest version.
My current (hopefully temporary) workflow is that I push the changes to A/scripts/ to git. Then merge to main. Then copy A/scripts/ to B/, overwriting the old B/scripts/. Same for C. Then push the changes to git directly into main branch again.
After a lot of searching, I’m starting to have a feeling that this “simple” goal is harder to achieve that I initially thought.
Does anyone have some suggestions on how to tackle this? I was thinking that maybe it’s possible to run an automated custom script after a merge, that checks finds the most recently updated scripts folder and overwrites the other ones with it. But it seems like a crude fix, if at all possible.
Thanks in advance!