Our repository includes a sub-repository inside it. Once the PR is issue, tests are run through bitbucket-pipelines and they work perfectly.
However, when we merge the same PR to the "development-branch", the 'build setup' step of the pipeline fails (I don't know how much of this is under my control through the YAML configuration). Here is a dummy error log
HEAD is now at 908c7e319 Merged in brandLevelErrorReportDev (pull request #4043)
+ git config user.name bitbucket-pipelines
+ git config user.email <valid>
+ git config push.default current
+ git config http.${BITBUCKET_GIT_HTTP_ORIGIN}.proxy http://localhost:29418/
+ git remote set-url origin http://bitbucket.org/$BITBUCKET_REPO_FULL_NAME
+ git reflog expire --expire=all --all
+ echo ".bitbucket/pipelines/generated" >> .git/info/exclude
+ CONFLICT_EXIT_CODE=3
+ git merge e81742c010ef --no-edit || exit $CONFLICT_EXIT_CODE
Auto-merging .gitignore
CONFLICT (content): Merge conflict in .gitignore
Auto-merging RandomService/RandomService.js
CONFLICT (content): Merge conflict in RandomService/RandomService.js
Failed to merge submodule RandomService/brand-files (not checked out)
CONFLICT (submodule): Merge conflict in RandomService/brand-files
Auto-merging RandomService/helpers/brand-functions.js
CONFLICT (content): Merge conflict in RandomService/helpers/brand-functions.js
Auto-merging RandomService/helpers/database-functions.js
Recursive merging with submodules currently only supports trivial cases.
Please manually handle the merging of each conflicted submodule.
This can be accomplished with the following steps:
- come back to superproject and run:
git add RandomService/<sub-repository folder>
to record the above merge or update
- resolve any other conflicts in the superproject
- commit the resulting index in the superproject
Automatic merge failed; fix conflicts and then commit the result.
However, when I copy the "developement-branch" locally (with the merged PR) and run the following command,
git add RandomService/<sub-repository folder>
I get "nothing to commit, up to date"

I tried the suggested commands, and tried to improve the yml to have
clone:
depth: 5 # previously the value was "full"
The solutions have not worked