1

So what I want to do is: There is an old branch foo with some changes that I want in a new branch. Here's what I did:

I created a new branch bar based off of the branch foo and wanted to merge changes from the current working branch baz into bar. Now I did:

git fetch origin
git checkout -b "baz" "origin/baz"
git merge "bar"

There were a few conflicts that I have resolved manually and I have now staged these changes but it won't let me stage some submodules, I get:

$ git add path/to/submodule/qux
error: unable to index file path/to/submodule/qux
fatal: updating files failed

why is this and how do I get these merged, staged & committed? It's okay to just use the latest submodule as they are present in baz.

When I do $ git submodule update --init --recursive, I get Skipping unmerged submodule path/to/submodule/qux and when I cd there, the direcory is empty...

BitFreak
  • 406
  • 3
  • 10
  • 2
    Submodules are individual repositories. Go into the submodule and do it there, respectively. – dan1st Aug 08 '20 at 18:51
  • @dan1st Thank you for your feedback, I updated my original question accordingly – BitFreak Aug 08 '20 at 19:01
  • @LeGEC yes, perfect! That answered it! You can add it as an answer and I will accept, I had to simply do `git reset HEAD path/to/submodule/qux` – BitFreak Aug 08 '20 at 23:27

1 Answers1

1

First run reset :

git reset HEAD path/to/submodule/qux

You can then choose whichever version suits you for this submodule

LeGEC
  • 46,477
  • 5
  • 57
  • 104