We're very happy with GIT (but a little confused at first).
One problem is selecting in Jenkins a branch. Jenkins available plugins don't help for this task. Luckily, I've found this wonderful article that has helped me. But I've improved a little, and instead of launching a cron job for gathering the available branches, I calculate them on the fly.
I've created a parameter of type Extensible Choice, and added this script in other to feed it:
def ej(cmd) { def proc = cmd.execute(null, new File("/home/jenkins/jobs/MyProject/workspace")) def sb = new StringBuffer() proc.waitForProcessOutput(sb, sb) def cod = proc.exitValue() if (cod != 0) throw new Exception("Error ${cod} when invoking '${cmd}':\n${sb}") sb.toString() } ej("git fetch --all") ej("git remote prune origin") def re = ~/->/ ej("git branch -r").tokenize("\n").grep({!re.matcher(it).find()}).collect() { it.replace("origin/", "").trim() }
It's easy to debug thanks to the button Run the Script Now.
Now you can easily select a branch with a combo box!!.