There is no method that "avoid[s] individual setup". You can, however, make setup as simple as possible. For instance, suppose that the setup script clones the repository and sets up the hook. Then the setup is simply to run:
$ clone-and-set-hook [optional arguments]
Of course, that leaves the problem of getting everyone the clone-and-set-hook
script. So instead, it could be three commands:
$ git clone ...url... [optional additional arguments]
$ cd clone-we-just-made
$ ./auxiliary/set-hook
where auxiliary/set-hook
is a script that is included in the repository itself. The script should then check that you are in the correct Git repository (that you issued the cd
command above), and that there is no pre-commit hook yet, and if so, set up the pre-commit hook.