Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
docs:git:hooks [2010/10/08 23:37] – created billh | docs:git:hooks [2011/01/05 16:19] (current) – billh | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== hooks ====== | ====== hooks ====== | ||
+ | git hooks will fire at various times, depending on the name. You can find example hooks inside .git/hooks/ in any git project. | ||
+ | |||
+ | ===== build number ===== | ||
+ | You might want a distinct number to represent this " | ||
+ | <code sh> | ||
+ | #!/bin/sh | ||
+ | |||
+ | git log|head -n 1|cut -c 8-13 - > BUILD | ||
+ | </ | ||
+ | |||
+ | :!: Don't forget this gotcha...when you change branches, the build file would keep the commit hash from the last commit. | ||
+ | |||
+ | You should also see [[#global hooks]]. | ||
===== pre-commit: store compressed database dump with each commit ===== | ===== pre-commit: store compressed database dump with each commit ===== | ||
Line 12: | Line 25: | ||
exit $? | exit $? | ||
</ | </ | ||
+ | |||
+ | ===== global hooks ===== | ||
+ | There are several ways to set up hooks so that all projects use the same set of files. | ||
+ | |||
+ | ===== External Links ===== | ||
+ | * http:// |