Answer Posted / Anita
To configure a Git post-commit hook in Jenkins, follow these steps:n1. Navigate to the repository on your local machine and create a new file called 'post-commit' without any extension.n2. Open the file with a text editor and paste the following command: curl -X POST --data 'token=YOUR_JENKINS_TOKEN' https://YOUR_JENKINS_URL/github-webhook/n3. Replace 'YOUR_JENKINS_TOKEN' with your Jenkins API token and 'YOUR_JENKINS_URL' with the URL of your Jenkins instance.n4. Save the file, make it executable (chmod +x post-commit), and add it to the Git repository.n5. Push the changes to the repository to trigger the hook.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category