Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins not building new branch on first push

Tags:

github

jenkins

I am using the github plugin in Jenkins and my automatic builds are working for the most part. However, a build only occurs after the second push to a branch. When I create a new branch using git push origin branch_name:branch_name the jenkins build is not kicked off. I have to make another commit to the same branch for that to work. How can I fix this?

like image 831
KonradS Avatar asked Oct 19 '22 15:10

KonradS


1 Answers

It turned out that my new branch was no different than my old branch so it wasn't viewed as a change. As in it had the same commit history with no additions.

I literally just did

                 git branch -b new_branch
                 git push origin new_branch:new_branch

The web hook log showed that jenkins recognized the new branch but said --> no changes.

like image 162
KonradS Avatar answered Oct 23 '22 01:10

KonradS