Git Hooks Update


Example

This hook is called after pre-receive, and it works the same way. It's called before anything is actually updated, but is called separately for each ref that was pushed rather than all of the refs at once.

This hook accepts the following 3 arguments:

  • name of the ref being updated,
  • old object name stored in the ref, and
  • new object name stored in the ref.

This is the same information passed to pre-receive, but since update is invoked separately for each ref, you can reject some refs while allowing others.