Extracted Data from Code
My git repository contains both code and resources. The project is Scala, but Java would be similar: the resources are contained in shared/src/main/resources path, the rest are sources. Let us call this repository "code repository".
I want some people to be able to edit the resources, but not to have any access to the rest of the repository. To achieve this I have created a new repository (let us call it "data") and committed two commits into it:
- an initial commit from the code repository (I was lucky this commit did not contain any files at all), therefore including it was easy (this prevents unrelated history error)
- a commit with the current state of
shared/src/main/resources
People who contribute only to data get access only to the "data" repository.
Merging Data to Code
This works quite fine, I am able to merge any changes done in the "data" repository to my "code" repository without any issues.
Merging data changes from Code to Data
The only trouble is when I make any changes to resources in my "code" repository. When I attempt to merge such changes, git wants to merge all commits which I previously did not include in the "data" repository, effectively adding all the code to it. I can fix such merge by using --no-ff and --no-commit options and reverting the unwanted file insertions before committing the merge. The result obtained this way looks good in the "data" repository, but then merging from "data" to "code" become difficult, as this "reverting" is now part of the merge commit and git wants to apply it. I can prevent it the same way, but this again only brings the problem to the other side.
Is there any workflow or tool which could be used for such situation? I am aware of submodules, but I would like to stay clear of them, as they bring their own problems.
I am aware this is probably not intended use of Git and not something which is normally done and I am kind expecting the answer "no, this is not possible", but seeing the sheer amount of creativity some people show when using Git I told myself I will ask here with a hope some solution can be found.