Reputation: 55
I want to know if there is a way I can have an automatic email sent out after a person makes a commit in a git repo. Each time somebody pushes something into the repo, I would like to have an automatic email sent out to an email list I have specified.
Thank you.
Upvotes: 1
Views: 125
Reputation: 11337
EDIT: in your git bare repository, look for the 'hooks' directory (should be in .git/hooks). You might see some commented example there but the idea is that each hook (event) is represented by a script file (the filename telling you which hook it is). In this script file you can do whatever you like. I (for example) used it to trigger my jenkins to start a new build. You can use it for sending an email.
more info: Customizing Git - Git Hooks and 5 Ways to Send Email From Linux Command Line
If it solved your problem please accept this answer ;-)
Upvotes: 1
Reputation: 37
I point you to this tutorial where they go into detail on setting up an email list to be notified on git changes http://www.systutorials.com/1473/setting-up-git-commit-email-notification/
Upvotes: 1