I worked on two tasks at the same time : writing some code and make a folder of my working tree a submodule. When I switched task, I simply git stash save
my modified files. The problem is that my modified files are now part of the new submodule.
And when I try to do a git stash pop
on the top folder, I got a lot of conflicts
$ git stash pop
error: refusing to lose untracked file at 'folder/file1'
error: refusing to lose untracked file at 'folder/file2'
[and so on]
CONFLICT (modify/delete): [folder]/file1 deleted in Updated upstream and modified in Stashed changes. Version Stashed changes of [folder]/file1 left in tree.
CONFLICT (modify/delete): [folder]/file2 deleted in Updated upstream and modified in Stashed changes. Version Stashed changes of [folder]/file2 left in tree.
[and so on]
CONFLICT (file/directory): There is a directory with name [folder] in Stashed changes. Adding [folder] as [folder]~Updated upstream
Where [folder] is the previous folder/new submodule
I did a clean clone of the complete repo and the there is no problem with the new submodule.
Is there a way to transfer the stash to the submodule? Or to get the files in the stash and merge them manually in the submodule?