We currently enforce a standard set of hooks by running a cron job every 10 minutes that creates a symlink to a central hooks directory in any new repository that does not already have the symlink.
Starting with Git 2.9, it is now possible to configure core.hooksPath to specify a central hooks directory common to all repos. This seems a better approach as it is more obvious, and is in effect the moment a new repo is created.
Q1.
To leverage core.hooksPath in Bitbucket Server, I'm guessing that we would set the configuration in the ~/.gitconfig for the user running Bitbucket Server. Is this correct?
Q2.
Do hooks in a repository .git/hooks directory take precedence over hooks in the core.hooksPath location? If not, once core.hooksPath is set, how does one override the global hooks for a specific repository?