windows git 邮件通知

准备工具

开源mail server

hmail

命令行发邮件的工具

blat

初始化下blat,注意域名的修改blat -install localhost admin@localmail.ddatsh.com

blat -body test -to admin@localmail.ddatsh.com -s "miss you" -u admin -pw adminblat -base64 -charset GB2312 -body 中文 -to admin@localmail.ddatsh.com -s "测试" -debug

建空仓库

git init --bare

设置接收人员

git config hooks.mailinglist "admin@localmail.ddatsh.com "

git config hooks.envelopesender "admin@localmail.ddatsh.com"

本质是

.git\config

[hooks]
    mailinglist = admin@localmail.ddatsh.com
    envelopesender = admin@localmail.ddatsh.com
    emailprefix = "[GIT] "
    showrev = "git show -C %s; echo"
post-receive.sample

搜索post-receive.sample,打开后内容有post-receive-email,在gitster里有内容COPY过来,改名为post-receive

send_mail()
{
    if [ -n "$envelopesender" ]; then
        #sendemail -t admin@localmail.ddatsh.com -f admin@localmail.ddatsh.com -m
        blat -to admin@localmail.ddatsh.com -s "git"  -q
        #/usr/sbin/sendmail -t -f "$envelopesender"
cmd /c "echo 1 >> init.txt"
cmd /c "git add ."
cmd /c "git commit -m 1"
cmd /c "git push origin master"
To: admin@localmail.ddatsh.com
Subject: [GIT] test branch master updated. a63fc11d7c086f719c8d08d36df78c0cf7cbb6bf
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 45384097f58cfae3c65a1b43aaa295d11615fdf8
X-Git-Newrev: a63fc11d7c086f719c8d08d36df78c0cf7cbb6bf

This is an automated email from the git hooks/post-receive script. 
It was generated because a ref change was pushed to the repository containing the project
 "test".

The branch, master has been updated
       via  a63fc11d7c086f719c8d08d36df78c0cf7cbb6bf (commit)
      from  45384097f58cfae3c65a1b43aaa295d11615fdf8 (commit)

Those revisions listed above that are new to this repository have not appeared on 
any other notification email; so we list those revisions in full, below.

- Log -----------------------------------------------------------------
commit a63fc11d7c086f719c8d08d36df78c0cf7cbb6bf
Author: ddatsh 
Date:   Thu Feb 9 14:17:29 2012 +0800

    1

diff --git a/init.txt b/init.txt
index 77fe233..eccec7d 100644
--- a/init.txt
+++ b/init.txt
@@ -11,3 +11,4 @@
 1
 1
 1
+1

-----------------------------------------------------------------------

Summary of changes:
 init.txt |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


hooks/post-receive
-- 

test
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值