Short story: I want to tell git to ignore a directory when merging. I know git doesn't work that way...
Long Story: I have a project that will be deployed on two different platforms. Every platform needs some tweaks to the code for the deploy.
I have two branches, one for every platform: PlatformA and PlatformB. The two branches are practically identical. The only difference is in a couple of files and a directory that needs to be present on one platform but not on the other. This is the scenario:
PlatformA branch:
- dir1
- file1
- dir2
- file2
PlatformB branch:
- dir1
-file1
The problem appears when I'm working on platformA and make changes to file1. I want these changes to also be available on platformB. The problem is when I do the merge, git adds dir2 and file2 to platformB.
I also want to be able to work on platformB and make changes to file1 and be able to merge to platformA without git removing dir2 and file2.
So the question is: There is any way to have two mergeable divergent branches? OR There is a way to tell git to ignore a directory/commit?
I have tried this solution but only works when merging ProjectB->ProjectA, not the other way around (git copies dir2 and file2 onto ProjectB).
Also, I think I can cherry-pick every time, but that just seems cumbersome and prone to erros.
Thanks in advance!