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

Clone to directory named for repository

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: git-plugin
    • Labels:

      Description

      In a Jenkins Job you can select to use git to clone / pull from multiple repositories but it always pulls straight to the working directory so if you have multiple they end up overwriting each other.

      What I'd like is a checkbox to say clone to a directory (under the workspace) named for the git repository.

      So (when checked) if I had the command as:
      https://github.com/jenkinsci/jenkins.git

      it would checkout to .../workspace/job_name/jenkins

        Issue Links

          Activity

          Hide
          rmorgenstein Ruth Morgenstein added a comment -

          Have you tried specifying a subdirectory in Advanced: "Local subdirectory for repo (optional)"?

          This has worked for me.

          Show
          rmorgenstein Ruth Morgenstein added a comment - Have you tried specifying a subdirectory in Advanced: "Local subdirectory for repo (optional)"? This has worked for me.
          Hide
          thaggie Tom Haggie added a comment -

          I can specify one sub directory but I need one for each of the two repositories I'm connecting to.

          Show
          thaggie Tom Haggie added a comment - I can specify one sub directory but I need one for each of the two repositories I'm connecting to.
          Hide
          rmorgenstein Ruth Morgenstein added a comment -

          Use the Multiple SCM plugin. Make sure you set the Advanced setting:"Unique SCM name (optional)".
          https://wiki.jenkins-ci.org/display/JENKINS/Multiple+SCMs+Plugin

          Show
          rmorgenstein Ruth Morgenstein added a comment - Use the Multiple SCM plugin. Make sure you set the Advanced setting:"Unique SCM name (optional)". https://wiki.jenkins-ci.org/display/JENKINS/Multiple+SCMs+Plugin
          Hide
          dougborg Doug Borg added a comment -

          Ruth Morgenstein, that is not exactly ideal as the multiple SCMs plugin does not support post-commit / post-update triggers.

          Furthermore, it just makes sense that the "Local subdirectory for repo" should be a per-repo option, not part of the global git configuration. Even the name of the option is confusing the way it is now and other SCM plugins have the ability to do this without having to resort to the Multiple-SCMs Plugin.

          Show
          dougborg Doug Borg added a comment - Ruth Morgenstein , that is not exactly ideal as the multiple SCMs plugin does not support post-commit / post-update triggers. Furthermore, it just makes sense that the "Local subdirectory for repo" should be a per-repo option, not part of the global git configuration. Even the name of the option is confusing the way it is now and other SCM plugins have the ability to do this without having to resort to the Multiple-SCMs Plugin.
          Hide
          lavenj Jake Lavenberg added a comment -

          Just wanted to agree with Doug's comment above. Would like to have a subdir option available per-repo.

          Show
          lavenj Jake Lavenberg added a comment - Just wanted to agree with Doug's comment above. Would like to have a subdir option available per-repo.
          Hide
          rocco LuFrija added a comment -

          I just wanted to add that using the multiple-SCM plugin leads to an additional problem: the changes (commits and comments) are displayed only for the GIT repo that is set as first SCM.

          Show
          rocco LuFrija added a comment - I just wanted to add that using the multiple-SCM plugin leads to an additional problem: the changes (commits and comments) are displayed only for the GIT repo that is set as first SCM.
          Hide
          marc2112 Marc Breslow added a comment -

          With Multiple-SCM plugin you also don't get the GIT_URL and GIT_SHA for all the repos.

          Show
          marc2112 Marc Breslow added a comment - With Multiple-SCM plugin you also don't get the GIT_URL and GIT_SHA for all the repos.
          Hide
          lievencardoen Lieven Cardoen added a comment -

          Is there already a solution for this without using the multiple-SCM plugin?

          Show
          lievencardoen Lieven Cardoen added a comment - Is there already a solution for this without using the multiple-SCM plugin?

            People

            • Assignee:
              ndeloof Nicolas De Loof
              Reporter:
              thaggie Tom Haggie
            • Votes:
              11 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated: