0

In my own gitlab repo I have included a public, third party submodule from github. git submodule status shows me the submodule points to an older commit. .gitmodules tells me the path and url (https://github.com...). Now, I want to get the latest version.

The suggestions in Update Git submodule to latest commit on origin results in

git checkout master
error: pathspec 'master' did not match any file(s) known to git.

git submodule update --init --recursive seems to do nothing.

git submodule update --remote --merge
fatal: Needed a single revision
Unable to find current origin/master revision in submodule path '...'

Then trying (from Unable to find current origin/master revision in submodule path)

git pull --recurse-submodules

It pulls from my gitlab (Already up to date.), but not the latest commit from github.

I'm not sure if, I messed anything up.

  • 1
    They probably renamed their `master` branch to `main`. You'll need to do the same in your settings. – torek Oct 05 '21 at 23:48

1 Answers1

0

I solved my problem with running in the submodule:

git reset --hard
git pull

And then outside of the submodule

git commit -m "update" submodule
git push