git submodule “you need to resolve your current index first” but there are no merge conflicts

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



git submodule “you need to resolve your current index first” but there are no merge conflicts



I have this weird issue, I just can't solve. Jenkins is building from repo.



It checks out the apps current commit (this is correct), it then initialises submodules (also correct, and finds the correct commit).



But when it tries to do git submodule update --init --recursive repo



it bails with:
app/views/license/edit.html: needs merge



Problem is, there are no conflicts, and that file in the current commit src is perfectly fine...



I just have no idea where to go from here.


> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git@bitbucket.org:TEAM/api-backend.git # timeout=10
Fetching upstream changes from git@bitbucket.org:TEAM/api-backend.git
> git --version # timeout=10
using GIT_SSH to set credentials
> git fetch --tags --progress git@bitbucket.org:TEAM/api-backend.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/dev^commit # timeout=10
> git rev-parse refs/remotes/origin/refs/heads/dev^commit # timeout=10
Checking out Revision 99ab7742966fd82f21044e7bf5f405eaf3bd085b (refs/remotes/origin/dev)
> git config core.sparsecheckout # timeout=10
> git checkout -f 99ab7742966fd82f21044e7bf5f405eaf3bd085b
Commit message: "Front-end update"
> git rev-list --no-walk 99ab7742966fd82f21044e7bf5f405eaf3bd085b # timeout=10
> git remote # timeout=10
> git submodule init # timeout=10
> git submodule sync # timeout=10
> git config --get remote.origin.url # timeout=10
> git submodule init # timeout=10
> git config -f .gitmodules --get-regexp ^submodule.(.+).url # timeout=10
> git config --get submodule.compose/web.url # timeout=10
> git config -f .gitmodules --get submodule.compose/web.path # timeout=10
> git submodule update --init --recursive compose/web
hudson.plugins.git.GitException: Command "git submodule update --init --recursive compose/web" returned status code 1:
stdout: app/views/license/edit.html: needs merge

stderr: error: you need to resolve your current index first
Unable to checkout '71e9f5f5d30ec8b2bcd7d341e4b607ab123a4ece' in submodule path 'compose/web'



I tried a dummy commit with some changes to the file in question and merged to dev to branch, but that didn't solve it...



What confuses me, is why isn't it telling me there are conflicts when I merge?



Further tests



I did a fresh clone of the parent repo. And ran git submodule --init --recursive compose/web



and it cloned and checked out the right branch successfully...



So I can't even replicate this locally.



Any ideas?





Is your job doing a cleanup of the workspace before cloning the repo?
– VonC
Aug 6 at 4:39





There must be some merge conflict in some Git repository, but it's certainly not obvious which repository's index has a conflict, nor why.
– torek
Aug 6 at 6:21





@VonC - That was the issue; Jenkins was actually the problem, not the repo itself. We rebuilt the project from the latest dev branch and it sorted itself out. Thanks.
– Trent
Aug 6 at 23:06




2 Answers
2



As commented, the issue was at the Jenkins workspace level.



If the job is rebuilt from scratch (empty workspace), the problem goes away.



Looks like you have merge conflict. Try:


git mergetool app/views/license/edit.html






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard