Search code examples
gitgit-mergegit-submodulesgit-merge-conflict

Can't resolve merge conflict with git submodule folder


I have two git branches, develop and redesign that I need to merge. I have a submodule called library where its updates are being tracked by develop. When I run 'git merge' it says library has been modified by both even though I haven't touched the library submodule. When I click on library in VS Code to see the conflicting changes I see this:

diff --cc library
index 749618f9,589a7ae5..00000000
--- a/library
+++ b/library

I've tried deleting the library folder and running 'git submodule update' while in the redesign branch before merging with no success. I added ignore = all to the .gitmodules file in redesign but didn't work. How do I get rid of the merge conflict with this submodule?


Solution

  • I solved the issue. I found the answer from this reply to similar StackOverflow question: https://stackoverflow.com/a/29971977/2026659. When I ran 'git add' to library and committed it, the issue went away. Another developer on my team changed the hash associated with the library submodule.