jenkinsci / jenkinsci/github-branch-source-plugin

[JENKINS-44170] Support for initializing and updating submodules before automatic merge

Open
#1,081 1 comment 0 reactions 0 assignees View on GitHub
component:github-branch-source-plugin enhancement imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
217
Forks
398
Avg merge
30m
Merged PRs (30d)
1

Description

I get errors like

Failed to merge submodule XXX (not checked out)


in a multibranch pipeline project I use to automatically merge and build pull requests because it fails to initialize and update submodules automatically. There should be a way to do that by configuration, I think.

As a workaround I had to add a git hook to do it on each checkout (feel free to use it if you need):

mkdir -p ~/.git-templates/hooks

git config --global init.templatedir '~/.git-templates'
echo -e '#!/bin/sh\ngit submodule update --init --recursive' > ~/.git-templates/hooks/post-checkout

It's definitely not the cleanest solution so I strongly suggest a long-term solution for that.

---
Originally reported by marcodeneu, imported from: Support for initializing and updating submodules before automatic merge


  • status: Open
  • priority: Major
  • component(s): github-branch-source-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-02

Raw content of original issue

I get errors like



Failed to merge submodule XXX (not checked out)



in a multibranch pipeline project I use to automatically merge and build pull requests because it fails to initialize and update submodules automatically. There should be a way to do that by configuration, I think.

As a workaround I had to add a git hook to do it on each checkout (feel free to use it if you need):



mkdir -p ~/.git-templates/hooks

git config --global init.templatedir '~/.git-templates'
echo -e '#!/bin/sh\ngit submodule update --init --recursive' > ~/.git-templates/hooks/post-checkout


It's definitely not the cleanest solution so I strongly suggest a long-term solution for that.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.