Status: Closed (View Workflow)
Resolution: Won't Do
In a freestyle project, I need to add Git under Source code management, so that I can also add SSH credentials. I do not want the "Branches to build" section, as it leads to undesired behavior. When I click on the red X in the top right, this section gets removed. I then Apply and Save. When I reopen the project configuration, the "Branches to build" section is back and set to "*/master" by default. The bug is the inability to remove this section.
markewaite Since I am building from multiple branches, constantly switching between them, I want to omit specifying a branch in "Branches to build". If I put "master" for example, the Jenkins build will switch to that branch, which is undesirable. I've tried leaving the field empty or using a regex, but it would be easiest if I could just remove it and manually trigger the job.
Can you explain further what is not desirable about "Branches to build"? What behavior are you trying to achieve by removing the "Branches to build" section from the job definition?
I consider it a mandatory section, not optional. I agree that since the UI allows the section to be removed, it should remain removed on future edits of the job definition. When that issue is fixed, it will probably be fixed by making the "Branches to build" not be optional.