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. 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. 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?