How to resolve git merge conflicts in a submodule from `git stash pop`

I have a git repository with a submodule. I need to change the changes that I previously hid. However, this causes a merge conflict by reference submodule.

I want to save my changes from the wallet, except for the submodule. For most code files, I can resolve the conflict by editing the conflicting file, but this does not look like a submodule.

How can I resolve the merge conflict and still fetch my changes from the wallet?

$ git stash pop warning: Failed to merge submodule some-submodule (commits don't follow merge-base) Auto-merging some-code Auto-merging some-submodule CONFLICT (submodule): Merge conflict in some-submodule 

 $ git status # On branch some-branch # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: some-code # # Unmerged paths: # (use "git reset HEAD <file>..." to unstage) # (use "git add/rm <file>..." as appropriate to mark resolution) # # both modified: some-submodule 
+6
source share
1 answer

As the comments say git status : git reset HEAD some-submodule .

By the way, after you double checked that your tree and index are as they should be, you probably want git stash drop . git stash pop usually does this, but there is no conflict.

+3
source

Source: https://habr.com/ru/post/982910/


All Articles