How to configure permanent git hook ?!

Hello everyone,
I work with GitLab CE 17.1.2 (self-managed) and I want to add into the project an enforcement that each commit will contain a message with a Jira task code.
I created the bash script for that… and it work locally. However after pushing the code to server and pulling back changes - the hook disappeared .
Has anyone found a way to set commit-msg or pre-commit hook?
I want it to apply only to some projects , not for all.

Thanks !