0PricingLogin
Git Advanced: Monorepo, Submodules & Workflows · Lesson

Server-Side Git Hooks

Explore server-side hooks such as `pre-receive` and `update` for repository-wide policy enforcement and automation.

Welcome to Server-Side Hooks

In the previous lesson, we learned about client-side Git hooks. Now, let's explore server-side hooks, which operate on the Git server itself.

These hooks are powerful tools for enforcing repository-wide policies and automating tasks before or after changes are accepted into the central repository.

Client vs. Server Hooks

The key difference between client-side and server-side hooks is where they run:

  • Client-side hooks: Run on your local machine before actions like committing or pushing. They help enforce local best practices.
  • Server-side hooks: Run on the central Git server after you push changes, but before they're fully integrated. They ensure repository-wide rules are met by everyone.

Server-side hooks provide a stronger guarantee that rules are followed by all contributors.

All lessons in this course

  1. Client-Side Git Hooks
  2. Server-Side Git Hooks
  3. Git Configuration & Aliases
  4. Sharing Hooks with the Team using Husky
← Back to Git Advanced: Monorepo, Submodules & Workflows