0

I have a Jenkinsfile and inside of it there is a "git" command to fetch the sourcecode of my java service. also I created a job with "pipeline script from SCM" to fetch the jenkinsfile from git. However when use some specific commands like git show to findout commit message, failure happens. Commit message show the git of main pipeline, instead of git that is fetch inside of Jenkinsfile

1

1 Answer 1

0

I finally found the answer by myself. When run a jenkins with "pipeline script from SCM" to get Jenkinsfile from Git, all the git commands that i used on that Jenkinsfile, returned current Git fetch. As I said, inside the Jenkinsfile, i use another git command to fetch my service inside Jenkinsfile. to reach the git commit message of the git, I used the below command.

git log --format=%H -n 1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .