4

Since I'm using Gitflow all my branches include a slash. Like "feature/awesome-feature".

When I try to tell Jenkins to build this branch it throws an error "ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job."

Is it possible to use "/" in branch names at all? The issue was reported/fixed/unfixed numerous times. So I'm not sure about the current state.

KayJ
  • 273
  • 4
  • 15

1 Answers1

4

Yes I build branches like this all the time and it works just fine.

Set your branch as "refs/heads/feature/awesome-feature"

Which version of jenkins are you on?

I'm on 1.580.3

Do you have any commits yet? If your repo is empty, it would have no HEAD, and therefore no branch, as in this question: While building a git project from jenkins it shows an error like couldn't find any revision to build

Community
  • 1
  • 1
Somaiah Kumbera
  • 7,063
  • 4
  • 43
  • 44
  • I'm using 1.596.2. In the "Source-Code-Management" section "branches to build" I specify the branch as follows: `*/feature/awesome-feature`. It branches off from `develop`. Using a branch name `feature-awesome-feature` and specifying `*/feature-awesome-feature` works fine. – KayJ Jul 23 '15 at 11:58
  • Did you try giving the full path name? It should look like origin/develop/feature/awesome-feature – Somaiah Kumbera Jul 27 '15 at 08:46
  • 1
    Have you checked to make sure you don't have a colon ':' before the branch name? Which would make it a regex?? Have you checked that the branch names you use is correct? i.e do they match the names from git when you do a 'git branch' Have you tried using refs/heads/feature/awesome-feature ? – Somaiah Kumbera Jul 27 '15 at 10:49
  • Using "refs/heads/feature/awesome-feature" works! Thanks for that! :) If you post your comment as an answer I'll accept it. – KayJ Aug 18 '15 at 11:51
  • Edited my answer to reflect the solution. Also left the other stuff in case it helped someone else. Glad to know it worked for you. – Somaiah Kumbera Aug 20 '15 at 08:57
  • 1
    We should give Somaiah Kumbera a little _love_ and maybe even an accepted answer. I found this helpful. :) – ziff Jul 08 '17 at 20:53