Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git plugin for jenkins always fetches all branches

Tags:

git

jenkins

No matter what options I use to the Jenkins git plugin it always pulls down all branches:

git fetch --no-tags --progress ssh://[email protected]:7999/project/repo.git +refs/heads/*:refs/remotes/origin/* --depth=5

Instead of refs/heads/*:refs/remotes/origin/* I was expecting it to just do something like: +refs/heads/master:refs/remotes/origin/master. Configuration is as per screen shot.

Jenkins scm configuration

like image 253
eeijlar Avatar asked Dec 19 '25 09:12

eeijlar


1 Answers

Click the 'Advanced' button under the credentials field, and then update as per screen shot.

Jenkins configuration

In the screen shot I have used 'master' as the branch I want to fetch, if you are using a different branch then update as appropriate.

like image 187
eeijlar Avatar answered Dec 22 '25 00:12

eeijlar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!