Git Hooks

¿Qué son?

Mecanismos para activar scripts, cuando suceden ciertas acciones.

Tenemos 17 Hooks diferentes:

  • applypatch-msg
  • pre-applypatch
  • post-applypatch
  • pre-commit
  • prepare-commit-msg
  • commit-msg
  • post-commit
  • pre-rebase
  • post-checkout
  • post-merge
  • pre-receive
  • update
  • post-receive
  • post-update
  • pre-auto-gc
  • post-rewrite
  • pre-push

post-commit

$ git commit -m "Mensaje"
$ comandos ...

Resultado

$ git commit -m "Mensaje"

Servidor

$ git push ...

Hook

Deployment.sh

$ git pull ...

Todo con un solo comando

Made with Slides.com