Ban Midou
Ban Midou

Reputation: 73

Check-Out only changed files from Github using Jenkinsfile

I am using Jenkinsfile to get the latest code from github. checkout scm. Would it be possible to get only the files that are changed during the last commit? That means, instead of getting all the files in the repo, I require only the changed files/codes. Can this be done via Jenkins file?

Regards,

-Ban

Upvotes: 0

Views: 1622

Answers (1)

Ban Midou
Ban Midou

Reputation: 73

I have used the command - git archive --output=deploy.zip HEAD $(git diff --name-only HEAD HEAD~1 --diff-filter=ACMRTUXB) This will get the changed files between two commits. (latest and the penultimate one)

Upvotes: 1

Related Questions