Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
docs:git:hooks [2010/12/29 16:40] – billh | docs:git:hooks [2011/01/05 16:19] (current) – billh | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== build number ===== | ===== build number ===== | ||
- | You might want a distinct number to represent this " | + | You might want a distinct number to represent this " |
<code sh> | <code sh> | ||
#!/bin/sh | #!/bin/sh | ||
- | # | ||
- | # An example hook script that is called after a successful | ||
- | # commit is made. | ||
- | # | ||
- | # To enable this hook, rename this file to " | ||
git log|head -n 1|cut -c 8-13 - > BUILD | 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 26: | 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 ===== | ===== External Links ===== | ||
* http:// | * http:// |