My project structure looks like this:
Parent repository (PR)
- Child submodule 1 (S1)
- Child submodule 2 (S2)
- Child submodule 3 (S3)
When I want to rebase my parent repository it shows the following message:
Could not apply 53e9728... update submodules
Fast-forwarding submodule S1
Auto-merging S1
error: add_cacheinfo failed to refresh for path 'path/to/submodule'; merge aborting.
The problem only occurs when I try to rebase it. If I merge the branch to other branch it works fine!
I tried to use the solution here (changed core.autocrlf to false) and here (removed my branch and then pulled again from origin), but none of the solution fixed my issue. Is there any other way to fix the problem?
Edit: the problem occurs with one specific commit. I tried to cherry-pick that particular commit and the same error message showed up.
Edit 2: I ended up removing the commit from history. For me it was an option, but for others it may not be.
For future reference:
git rebase -i <commit id of the previous commit that needs to be deleted>
drop commit