• Icon: Improvement Improvement
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • git-plugin

      Currently, in a multibranch workflow job, git scm checks out in detached mode and not on ${env.BRANCH_NAME}. My script generates files based on git info, which is why I added those lines after "checkout scm" :

      {{sh "git branch -D ${env.BRANCH_NAME} || echo 1"
      sh "git checkout -b ${env.BRANCH_NAME}"}}

      Is there a way to make this a default ? Is there a reason why this is not done like this ?

          [JENKINS-32552] Multibranch project git branch checkout

          Jesse Glick added a comment -

          For whatever reason, the Git plugin checks out branch heads in detached mode. You can override this behavior with an extension.

          Jesse Glick added a comment - For whatever reason, the Git plugin checks out branch heads in detached mode. You can override this behavior with an extension.

          Jesse Glick added a comment -

          …for which you need JENKINS-31924.

          Jesse Glick added a comment - …for which you need JENKINS-31924 .

            markewaite Mark Waite
            thebignet Jean Detoeuf
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: