Hooks in .git/hooks aren’t part of the repository, so they never reach anyone else. Pointing git at a normal folder fixes that.
mkdir .githooks
git config core.hooksPath .githooks
Put executable scripts in .githooks with the usual names, like pre-commit or commit-msg, and commit the folder. From then on, git runs hooks from there instead of from .git/hooks. A small example that blocks leftover conflict markers:
#!/bin/sh
git diff --cached --check || exit 1
Save it as .githooks/pre-commit, run chmod +x on it, and any commit with whitespace errors or conflict markers is stopped with a message.
The path is relative to the top of the working tree, so it works from any subfolder. You can also set it globally to one folder of personal hooks for all repositories.
The catch is that the setting itself isn’t shared. Every person who clones the repository still has to run git config core.hooksPath .githooks once, which I’d put in the readme or in a setup script. Git does this on purpose: a repository can’t make your machine run its scripts without you agreeing to it. And setting core.hooksPath means git ignores .git/hooks completely, so move any hooks you already had there.
Further reading: githooks documentation, git-config documentation: core.hooksPath