How do I configure the appropriate Git hook to send a summary email whenever a set of changes is pushed to the upstream repository?
Not exactly a full answer since it is Github-specific, but if you happen to use Github it is extremely easy to configure "Service Hooks".
For each repository you wish to monitor, enter Settings / Service Hooks.
There are plenty of available integrations, such as Trac, Twitter, Amazon SNS, Jira, Asana, Bugzilla, FogBugz, IRC, Jabber, Pivotal Tracker, Trello and Email....
Simply select email and feed it with a group email address.
We use the email notifications to sync our developers.
Here is the simplest solution I've found:
1) Log in to your gitHub account on github.com
2) In the main tab click on Settings
3) From the main navigation choose Service Hooks
4) From Available Hooks choose Email
5) Fill in your email address in field Address
6) Check the checkbox Send from Author
7) Check the checkbox Active
8) Click on Update Settings
Optional: You can click on Test Hook for testing, check your inbox you should receive email.
Also there are images made according to the process:
And now for the grand final I have the answer which is tested and approved at my side.
How to send email to ALL development team members, when gitHub's Service Hooks->Email allows only at most 2 recipients }.
The answer is combination of Service Hook->Email @ GitHub && Google groups
You can use pre-commit:
#!/usr/bin/env ruby
require 'mail'
Mail.defaults do
delivery_method :smtp,
address: 'smtp.gmail.com',
port: 587,
user_name: '...',
password: '...',
authentication: 'plain',
enable_starttls_auto: true
end
changes=`git diff --cached --unified=0 Gemfile Bowerfile`
unless changes.empty?
Mail.deliver do
from '...'
to '...'
subject '[PROJECT] Plese confirm team can use libraries'
body changes
end
end
Install:
cd project
cp pre-commit .git/hooks
chmod +x .git/hooks/pre-commit
gem install mail
Test:
echo "# some change" >> Gemfile && git commit -m 'some change' Gemfile
If you use windows, scm-notifier would be helpful.
This is my way of send email notification to users every time some one push to the repository.
Setting Up Git Commit Email Notification
It's based on Andy Parkins's scripts. I change it to used SMTP to send email. Of course, gmail's SMTP can also be used.