I have a bare repository on a host machine and a local repository on my laptop. I have 2 hooks: one pre-commit and one post-receive hook. Both are in my local hook folder:
malek@laptop:~/Desktop/portfolio-website/.git/hooks$ ls
post-receive pre-commit
And of course, I push my local repository to the remote repository (my local pre-commit hook works fine) but my hooks are not updated on my bare remote repository.
malek@laptop:~/Desktop/portfolio-website/.git/hooks$ git push -u origin --all
Branch 'master' set up to track remote branch 'master' from 'origin'.
Branch 'production' set up to track remote branch 'production' from 'origin'.
Everything up-to-date
As you can see below:
malek@localhost:~/portfolio-website/hooks$ ls
applypatch-msg.sample pre-applypatch.sample pre-rebase.sample
commit-msg.sample pre-commit.sample pre-receive.sample
fsmonitor-watchman.sample prepare-commit-msg.sample update.sample
post-update.sample pre-push.sample
The git log master
command returns
commit 3403657fc4d08f406416711255cf04390a2df070 (HEAD -> master)
Author: “Malek <“myemail@gmail.com”>
Date: Sat Oct 26 18:06:06 2019 -0400
Write Makefile and hooks
commit 484c283a9faf0afed14328c9b71e635338c86187 (production)
Author: “Malek <“myemail@gmail.com”>
Date: Tue Oct 22 00:17:11 2019 -0400
Master branch creation
Why aren't my hooks updated on my remote repository if the commit was sent successfully?