thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

DevOps & Automation · Intermediate

Git Hook

A script Git runs automatically at points such as pre-commit, commit-msg, or pre-push, or on the server at pre-receive.

Definition

Client-side hooks in .git/hooks enforce local checks such as linting or formatting; they are not versioned by default, so tools like the pre-commit framework share them. Server-side hooks enforce policy centrally.

Example

A pre-commit hook runs black and flake8 and aborts the commit on failure.

Exam tip

Client hooks can be bypassed (--no-verify); enforce critical policy server-side or in CI.

Related terms