0

I'm very new to running a Git server, and I needed to trigger a Jenkins build upon pushing to Git.

A tutorial says to do this command:

curl http://[jenkins]/git/notifyCommit?url=[job]

but it doesn't tell you how to trigger that cURL upon a git push. Am I reading this wrong? If not, how do I do so? If I am, what am I supposed to do with this command?

Ryan
  • 197
  • 1
  • 3
  • 10

1 Answers1

1

I found it out by searching around the repo... you need to make the file

/path/to/repository/.git/hooks/post-commit

and add

 #!/bin/sh
 curl http://[jenkins]/git/notifyCommit?url=[job]
Ryan
  • 197
  • 1
  • 3
  • 10