change default git hooks

From the git-init man page (also works with git-clone if you are cloning an existing repo instead of creating a new one from scratch):

       --template=<template_directory>
           Provide the directory from which templates will be used. The
           default template directory is /usr/share/git-core/templates.

           When specified, <template_directory> is used as the source of the
           template files rather than the default. The template files include
           some directory structure, some suggested "exclude patterns", and
           copies of non-executing "hook" files. The suggested patterns and
           hook files are all modifiable and extensible.

You can modify the system-wide template directory (which defaults to /usr/share/git-core/templates, but may be in a different location on your machine), you can supply --template=<template_directory> on the command line when you create or clone the repo, or you can configure the default template directory in your config file:

[init]
     templatedir = /path/to/templates

Leave a Comment