I’ve been using hosted Git and enjoying it a lot.
I want to automatically run unit tests when I push to my git repo, and I want these tests to be run on multiple different machines (which are on different platforms that I intend to support).
It seems like it will be pretty simple to set up git repos as servers that I can push code to, but I know of no simple way to fire off e.g. make && make test when something gets pushed to the repo.
The alternative I came up with is to push to a repository (I can keep my hosted repo this way) and then use a completely separate method to trigger on my test servers a git pull && make && make test. This is perhaps more elegant but I feel like it’s not an ideal solution.
I’d also like for my servers to report back program output or at least a return value so I can tell if the tests failed or not. But that is out of the scope of this question.
You want to look at a “post update hook”.
http://www.kernel.org/pub/software/scm/git/docs/githooks.html