tags:

views:

125

answers:

2

I have recently needed to write git hooks, for all commits to reference a particular ticket.

I was hoping for a place to start learning. All the stuff in the pro git book is written in Ruby. Since Ruby is not my strong suit, can anybody share tutorials about git hooks written in other languages? (I'd particularly prefer Python or Bash scripts.)

+2  A: 

Here is an example of using Python for a hook. In general the hooks are language agnostic. You use the script to do some work or to exit with a 0/other return code to alter the flow of a git process.

Peter Loron
A: 

The examples that come with git are written in shell script; there are some basic ones in .git/hooks of each repo and more advanced ones installed to /usr/share/doc/git-core/contrib/hooks.

There's also more info on the various hooks available via $ man githooks.

intuited