Is it impossible to checkout a different branch in Jenkinsfile?

前端 未结 5 2106
耶瑟儿~
耶瑟儿~ 2021-02-05 08:03

I have two branches on BitBucket: master and develop. I\'ve also got a BitBucket Team Folder job configured on my Jenkins server to build that reposito

5条回答
  •  既然无缘
    2021-02-05 08:25

    The problem is that Jenkins is defining the origin with only the branch that is discovered.

    @swoop81 answer is working but if you just want to checkout one branch, you could fetch only this one.

    git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/
    git fetch --no-tags https:// +refs/heads/:refs/remotes/origin/
    

提交回复
热议问题