Git hooks allow scripts to be invoked when certain important git repository actions occur. This configuration controls the execution of client-side hooks on the Jenkins controller. It is recommended that git hooks be disabled on the controller.

The Jenkins controller uses git repositories to checkout Pipeline definitions, to detect changes in remote repositories, and to cache Pipeline shared libraries. Jenkins jobs that run on the controller may use git repositories in many other ways. It is strongly recommended that jobs are not run on the Jenkins controller. Refer to the controller isolation documentation for more details.

Client-side hooks are not copied when the repository is cloned. However, client-side hooks might be installed in a repository by build steps or by misconfiguration.

If hook scripts are allowed on the controller, a client-side hook script installed in a repository on the Jenkins controller will execute when the matching git operation is performed. For example, if hooks are allowed on the controller and a git repository on the controller includes a post-checkout hook, the hook script will run on the controller after any checkout in that repository. If hooks are allowed on the controller and a git repository on the controller includes a pre-auto-gc hook, the hook script will run on the controller before any automatic git garbage collection task.

See "Customizing Git - Git Hooks" for more details about git repository hooks.