In some jenkins shell command I create new git branch as follow:
git checkout -b new_branch
...
run more commands
..
sometimes running some commands is not successfull and the job exits. Now when I run the job again it says that the branch new_branch already exists.
Is there any option in jenkins to cleans up the locally created branches every time when the job starts or something like that?