Best solution can be:
Add a string parameter in the existing job
Then in the Source Code Management
section update Branches to build
to use the string parameter you defined
If you see a checkbox labeled Lightweight checkout
, make sure it is unchecked.
The configuration indicated in the images will tell the jenkins job to use master
as the default branch, and for manual builds it will ask you to enter branch details (FYI: by default it’s set to master
)