Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-15399

Changing remote URL doesn't update submodules

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • None

      If you create a project that has a relative submodule path. Say this is hosted in your personal github space:

      https://github.com/username/mainproject
      https://github.com/username/subproject

      The subproject it part of the mainproject with an entry link this in the .gitmodules:

      [submodule "subproject"]
      path = subproject
      url = ../subproject.git

      Using relative URLs has many benefits, a primary one being the checkout works over any protocol.

      If you setup a jenkins job to build mainproject everything works fine, if the project is then move to a different github account (say to your employers organisation):

      https://github.com/organisation/mainproject
      https://github.com/organisation/subproject

      Changing the URL the jenkins jobs works for pulling in changes from mainproject, but when submodule updates are attempted the old url still gets used. This seems to be because the origin remote in the mainproject repository doesn't get updated with the new URL and so all the relative URLs remain relative to that project.

          [JENKINS-15399] Changing remote URL doesn't update submodules

          Matthew Buckett created issue -
          Kelly Johnson made changes -
          Link New: This issue is related to JENKINS-8503 [ JENKINS-8503 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 146133 ] New: JNJira + In-Review [ 176540 ]
          Nicolas De Loof made changes -
          Assignee Original: Nicolas De Loof [ ndeloof ]
          Mark Waite made changes -
          Link New: This issue is related to JENKINS-63049 [ JENKINS-63049 ]

            Unassigned Unassigned
            buckett Matthew Buckett
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: