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

Git checkouts last built branch instead of specified "branch to build" when no change in branch


    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: git-plugin
    • Labels:
    • Similar Issues:


      I have a parameterized job which can build several Git branch. The "branch to build" is taken as job parameter.

      Starting from a new job, firstly I build branch A, and then branch B. Then I'd like to rebuild branch A, without any commit in any branch in the meanwhile. But when I launch the build with branch A as parameter, Jenkins still checkouts the last built branch (B).


      I suppose that Git plugin compare the SHA of the latest built commit with the SHA of the latest commit on remote branch: if this is different, all works as expected (checkout on the specified branch A), but if this is the same it still checkouts the last built branch B (why??).

      If I purge Git Build Data as described here (https://plugins.jenkins.io/git/#remove-git-plugin-buildsbybranch-builddata-script) I can rebuild branch A (but I cannot do this purge anytime!)


      Jenkins version: 2.164.3

      Git plugin version: 4.2.2

      Git client plugin version: 3.2.1

      Job Type: Maven job



          There are no comments yet on this issue.


            • Assignee:
              morettileo Leonardo Moretti
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: