How to force Jenkins to rebuild a branch?

How do you force Jenkins and Git to rebuild a branch it thinks it has already built?

We have Jenkins and the Git plugin set up to build our repository branches and merge them back to our repo on any SCM change. But this means, naturally, that Jenkins will ONLY build on an SCM change.

  • Who is successfully using git-flow?
  • Getting android.compileSdkVersion is missing! error gradle build
  • How do I get git to resolve merge conflicts by putting “ours first, then theirs”
  • What is the Difference Between Mercurial and Git?
  • Removing commit from middle of a branch
  • How to resolve git submodule conflict if submodule is not initialized
  • For example, say you push branch A to your origin repo. Jenkins build fails because it depends on branch B which was not built and integrated yet. Jenkins builds branch B successfully, but now the only way to get it to build branch A again (which should now work) is to introduce an artificial change to branch A so that Jenkins will think it’s “new”.

    Isn’t there a better way to do this?

  • Jenkins pipeline git command submodule update
  • merge-base analog for Mercurial and bzr (to find common ancestors as possible for a merge)?
  • Git rebase my forked branch on upstream master
  • Cordova 3.3.1-0.1.2 (Phonegap) plugins doesn't work
  • Edit a commit message using source control in Xcode
  • Publishing private code to OpenShift
  • One Solution collect form web for “How to force Jenkins to rebuild a branch?”

    You can do that using Git Parameter Plugin. After installing this plugin you have to :

    enter image description here

    1. tranform your job to a Parametrized job
    2. add a Git parameter named “branches”,
    3. select “Branch” for “Parameter Type” field
    4. enter a regex that match all branches you want to watch

    enter image description here

    1. use the branches parameter into Git “branches to build” field

    enter image description here

    1. now when you launch your build you can select the branch to build
    Git Baby is a git and github fan, let's start git clone.