I'm currently working with a repository that has recently been broken up for the sake of close-sourcing - modules have been moved to their own repository away from the 'main' one.
panel/
file.a
file.b
module1/ [untracked by panel repository, instead tracked in own repository now]
templates/
base.html
...
views.py
However, there is still work that was committed before this break-up, when the module1
repository was still part of panel
. My issue is working with the commits from before and after this break-up - I'm currently trying to cherry-pick
a commit with changes to files in both panel
and module1
, a commit that was created when both repositories were part of panel
. (No directory structure has changed, only git
's view of the repositories)
When I cherry pick while in the main repository's directory:
nasonfish@nasonfish ~/P/P/p/panel2> git cherry-pick 8b7316d1ebff49e95a7971f88e669f50d9cbbf86
error: refusing to lose untracked file at 'panel/module1/views.py'
error: refusing to lose untracked file at 'panel/module1/templates/module1/view-hdr.html'
error: refusing to lose untracked file at 'panel/module1/templates/module1/view-base.html'
error: refusing to lose untracked file at 'panel/module1/templates/module1/base.html'
error: could not apply 8b7316d... mybranch: This is my commit
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
I can see that I'm not looking to remove or add the files in the repository to the main repository because that just undoes the separation and combines the repositories - but I'm trying to make the cherry-pick
apply that commit to the files in both the base and child repository without merging the two. So, is there a way to force git to act like the files in a separate nested repository are part of the main repository in some way that allows cherry-picking commits from before the repositories were separated?