'fatal: Needed a single revision(gitlab runner error)
When adding a submodule to my Gitlab repo, I install the main branch:
git submodule add -b main ../../some-project/my-repo.git
After that I use the gitlab runner with variables:
GIT_SUBMODULE_STRATEGY: normal
GIT_SUBMODULE_UPDATE_FLAGS: "--remote --merge"
Everything works fine, but when you change the submodule branch in .gitmodules to another one, let's say "feature" (changed both manually in the file and with the command git submodule set-branch -b feature my-repo), then the pipeline drops with this: fatal: Needed a single revision
Unable to find current origin/feature revision in submodule path 'my-repo'
Locally, the command "git submodule update --init --remote --merge my-repo" works fine, updating the submodule to the latest commit in the "feature" branch
Solution 1:[1]
Found solution:
GIT_SUBMODULE_UPDATE_FLAGS: "--remote --checkout --no-single-branch"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | by_Shiki |
