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

Add support for multiple git repositories in a single workspace

      I have two repos namely - commonlib.git, project1.git, and both of the have the root directories Source and CM. My Jenkins job is MultiGit_Job. I tried to configure a Jenkins job with two repos. During build, the source code for the first project is extracted (found when monitoring during the build execution) and the job fails during the second repo cloning. When I have analyzed the job's workspace, the commonlib.git source is extracted directly under workspace. There is identifier for commonlib repo. Because project1 repo also same root structure, the cloning is failing. It is a critical item for us as we are migrating our projects to GIT now. Thanks

          [JENKINS-27668] Add support for multiple git repositories in a single workspace

          Sagayaraj David created issue -

          Mark Waite added a comment -

          The git plugin does not directly support checkout of distinct repositories under a single workspace.

          If you want to support distinct repositories under a single workspace, you'll need to use the multi-SCM's plugin to configure the separate repositories.

          Mark Waite added a comment - The git plugin does not directly support checkout of distinct repositories under a single workspace. If you want to support distinct repositories under a single workspace, you'll need to use the multi-SCM's plugin to configure the separate repositories.
          Mark Waite made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Ok - But I wonder if GIT plugin does not support checkout of distinct repositories under single workspace, why would it have the option to add multiple repositories in the configuration?

          I even tried Multi-SCM plugin - which is also not differentiating the different repo code in workspace. Everything appears directly cluttering under the JOB's workspace

          Sagayaraj David added a comment - Ok - But I wonder if GIT plugin does not support checkout of distinct repositories under single workspace, why would it have the option to add multiple repositories in the configuration? I even tried Multi-SCM plugin - which is also not differentiating the different repo code in workspace. Everything appears directly cluttering under the JOB's workspace

          Ok - But I wonder if GIT plugin does not support checkout of distinct repositories under single workspace, why would it have the option to add multiple repositories in the configuration?

          I even tried Multi-SCM plugin - which is also not differentiating the different repo code in workspace. Everything appears directly cluttering under the JOB's workspace

          Sagayaraj David added a comment - Ok - But I wonder if GIT plugin does not support checkout of distinct repositories under single workspace, why would it have the option to add multiple repositories in the configuration? I even tried Multi-SCM plugin - which is also not differentiating the different repo code in workspace. Everything appears directly cluttering under the JOB's workspace
          Sagayaraj David made changes -
          Resolution Original: Not A Defect [ 7 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          Mark Waite added a comment -

          The git plugin allows multiple copies of the same repository and will poll for changes within those repositories. It assumes that the repositories are the same basic repository, potentially with newer commits in some of the repositories rather than others.

          For example, I have a job which includes a reference to the jenkinsci/git-plugin.git repository and also includes a reference to MarkEWaite/git-plugin.git. That allows me to detect changes pushed by others, and changes which I push to my own repository.

          Mark Waite added a comment - The git plugin allows multiple copies of the same repository and will poll for changes within those repositories. It assumes that the repositories are the same basic repository, potentially with newer commits in some of the repositories rather than others. For example, I have a job which includes a reference to the jenkinsci/git-plugin.git repository and also includes a reference to MarkEWaite/git-plugin.git. That allows me to detect changes pushed by others, and changes which I push to my own repository.
          Mark Waite made changes -
          Status Original: Reopened [ 4 ] New: Open [ 1 ]
          Mark Waite made changes -
          Issue Type Original: Bug [ 1 ] New: New Feature [ 2 ]
          Summary Original: Multiple repo configuration dont have seperate local repo directory New: Add support for multiple git repositories in a single workspace

          Not sure if I understood correctly. I understand it as - Clone of same repository could be available to multiple remote users and the plugin can poll for changes of any number of such repositories and try to populate the local repo with pull from all of the configured remote repos. Is that correct?
          If the answer is yes, there could be merge conflicts of common files from different remote repos - how does the plugin handles it?

          Thanks for your support in tracking this.

          Sagayaraj David added a comment - Not sure if I understood correctly. I understand it as - Clone of same repository could be available to multiple remote users and the plugin can poll for changes of any number of such repositories and try to populate the local repo with pull from all of the configured remote repos. Is that correct? If the answer is yes, there could be merge conflicts of common files from different remote repos - how does the plugin handles it? Thanks for your support in tracking this.

            ndeloof Nicolas De Loof
            sagayd Sagayaraj David
            Votes:
            11 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved: