ANIL
ANIL

Reputation: 2682

How to perform Git checkout using Groovy script?

I want to perform git checkout operation using Groovy in Jenkins. How to achieve that?

Note: The Jenkins job in which I am trying to perform the checkout operation is not a pipeline job, it is a freestyle job and we are executing it under system groovy script.

Upvotes: 2

Views: 10120

Answers (1)

Vitalii Vitrenko
Vitalii Vitrenko

Reputation: 10395

You can just invoke git through groovy

["git", "checkout", "master"].execute()

Upvotes: 2

Related Questions