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

Clean After Checkout Results in Failed to Checkout Revision

    Details

    • Similar Issues:

      Description

      We're executing a job, and trying to perform a git clean. One of our submodules is dirty, and unfortunately since the Jenkins GIT plugin cleans after checkout, we get the following error:

      FATAL: Command "git submodule update --init --recursive" returned status code 1:
      stdout:
      stderr: error: Your local changes to the following files would be overwritten by checkout:
      minified/sidecar.js
      minified/sidecar.lite.js
      minified/sidecar.lite.min.js
      minified/sidecar.min.js
      Please, commit your changes or stash them before you can switch branches.
      Aborting
      Unable to checkout 'd58c3304230e4bf26ffb3fa6986d4b6ba90d4c66' in submodule path 'sugarcrm/sidecar'

      I tested using the Pre-SCM Buildstep plugin and performing a git clean before the checkout fixes the problem. Specifically having it perform:
      git submodule foreach --recursive git clean -fdx
      git submodule foreach --recursive git reset --hard

      before we do the checkout fixes it.

        Attachments

          Issue Links

            Activity

            rsennewald Ray Sennewald created issue -
            rsennewald Ray Sennewald made changes -
            Field Original Value New Value
            Description We're executing a job, and trying to perform a git clean. One of our submodules is dirty, and unfortunately since the Jenkins GIT plugin cleans after checkout, we get the following error:

            FATAL: Command "git submodule update --init --recursive" returned status code 1:
            stdout:
            stderr: error: Your local changes to the following files would be overwritten by checkout:
            minified/sidecar.js
            minified/sidecar.lite.js
            minified/sidecar.lite.min.js
            minified/sidecar.min.js
            Please, commit your changes or stash them before you can switch branches.
            Aborting
            Unable to checkout 'd58c3304230e4bf26ffb3fa6986d4b6ba90d4c66' in submodule path 'sugarcrm/sidecar'

            I tested using the Pre-SCM Buildstep plugin and performing a git clean before the checkout fixes the problem.
            We're executing a job, and trying to perform a git clean. One of our submodules is dirty, and unfortunately since the Jenkins GIT plugin cleans after checkout, we get the following error:

            FATAL: Command "git submodule update --init --recursive" returned status code 1:
            stdout:
            stderr: error: Your local changes to the following files would be overwritten by checkout:
            minified/sidecar.js
            minified/sidecar.lite.js
            minified/sidecar.lite.min.js
            minified/sidecar.min.js
            Please, commit your changes or stash them before you can switch branches.
            Aborting
            Unable to checkout 'd58c3304230e4bf26ffb3fa6986d4b6ba90d4c66' in submodule path 'sugarcrm/sidecar'

            I tested using the Pre-SCM Buildstep plugin and performing a git clean before the checkout fixes the problem. Specifically having it perform:
            git submodule foreach --recursive git clean -fdx
            git submodule foreach --recursive git reset --hard

            before we do the checkout fixes it.
            markewaite Mark Waite made changes -
            Link This issue is related to JENKINS-7376 [ JENKINS-7376 ]
            markewaite Mark Waite made changes -
            Link This issue is related to JENKINS-13910 [ JENKINS-13910 ]
            markewaite Mark Waite made changes -
            Link This issue is related to JENKINS-8315 [ JENKINS-8315 ]
            markewaite Mark Waite made changes -
            Link This issue is related to JENKINS-7445 [ JENKINS-7445 ]
            markewaite Mark Waite made changes -
            Link This issue is related to JENKINS-8503 [ JENKINS-8503 ]
            markewaite Mark Waite made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 154612 ] JNJira + In-Review [ 207590 ]

              People

              • Assignee:
                ndeloof Nicolas De Loof
                Reporter:
                rsennewald Ray Sennewald
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: