开发者

post-receive on a mirrored git repo?

I have a g开发者_开发问答it repo that mirrored from remote server. The remote server doesn't support post commit email notification and I don't have access to it either. Yet, I am hoping to have a way to detect new commits on this mirrored copy and send out corresponding email notification. Is it possible at all?

thanks

Oliver


yes. You can do an update hook and run a script every time there is an update. The 3 arguments that git passes to that hook are branch name, old hash and new hash. You can take this range and do an email per commit or just one for all the commits.

However, since this is a secondary repo, you will need to get a scheduled job to update it from the main one.


As part of gitmirror, I made myself a post-fetch hook to allow me receive a post from github (for example), do a fetch, and then do doc builds and such.

I also use this without github where I have a little bit of curl to notify the remote end that changes have come in. If you can get an http connection from the source to the dest, you can pretty much do whatever you want with these tools.

I move tons of commits over a lot of projects and proxy those down a kind of tree config on these.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜