I need two connected (forked) repositories to have a common folder whose contents are not considered when synchronizing the two repositories (both directions). In such a way where this requires no manual intervention when synchronizing to prevent accidental overwrites/merges/adds.
More details:
Consider repository A (private) and fork F (public). In each repository there is a folder /myprecious
.
In repository A the myprecious
folder contains lots of files and is actively worked on and needs to be part of the repository. In fork F the same folder only contains a subset of the files (placeholders) which normally won't be modified.
When receiving a pull request from fork F, the myprecious
folder should be left intact, nothing added, deleted or modified. Likewise when fetching A's changes into fork F the myprecious
folder's changes and additions should not be received but ignored.
Is it perhaps possible to include myprecious
in repo A via submodule (ie move the folder's contents its own repository), while removing the submodule link in fork F, replacing it with different (non-submodule) content? Will this work without merge conflicts? Or is there a better, easier way to set this up?