GIT HOOKS
Error prevention via automation with Git
By André Figueira
THE HOOKS: CLIENT
 Git hooks are scripts which get fired at certain events, e.g. push, commit, etc…
 Different types of ...
THE HOOKS: SERVER
 The cool stuff!
 Can be simple or complex…
 Types:
 Pre-receive
 Check to see what is being done a...
BENEFITS OF USING HOOKS
 Hooks can greatly increase our productivity
 How?
 Less time spent running additional diffs, c...
USEFUL RESOURCES
 http://git-scm.com/docs/githooks.html
Upcoming SlideShare
Loading in …5
×

Git hooks

486 views
353 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
486
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Git hooks

  1. 1. GIT HOOKS Error prevention via automation with Git By André Figueira
  2. 2. THE HOOKS: CLIENT  Git hooks are scripts which get fired at certain events, e.g. push, commit, etc…  Different types of hooks, client & server  Client e.g.  Pre-commit  Additional checks…  Post-commit  Notifications…  Post-checkout  Modifications to environment…  Et Cetera…
  3. 3. THE HOOKS: SERVER  The cool stuff!  Can be simple or complex…  Types:  Pre-receive  Check to see what is being done and prevent it if needed, e.g. deletion of a file  Post-receive  Runs after the push process has finished  Can be used for deployment  Simple checkout, rsync, etc…  The sky is the limit…
  4. 4. BENEFITS OF USING HOOKS  Hooks can greatly increase our productivity  How?  Less time spent running additional diffs, checking to see if files are synced between FTP and Git  Single point of contact from inception to deployment without the middleman that is FTP  BLAME! AKA, visibility of all deployment to production, know every move anyone makes to production code  Less mistakes, automation in deployment means we are reducing the factor of human error  Easier to do continuous integration  Run anything off the back of deployment e.g.  Notify all developers by email  Automatically download dependencies on server which are not stored in Git, e.g. via composer  So much more! Questions?
  5. 5. USEFUL RESOURCES  http://git-scm.com/docs/githooks.html

×