KayJ
KayJ

Reputation: 283

Jenkins build of a branch containing "/" fails

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.

Upvotes: 4

Views: 4778

Answers (2)

wO_o
wO_o

Reputation: 318

Adding the prefix "origin/" to the branchname worked for me.

origin/feature/mybranch

Upvotes: 0

Somaiah Kumbera
Somaiah Kumbera

Reputation: 7539

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

Upvotes: 4

Related Questions