0

I tried add post-commit function to .git/hook repository in server site.

But when I clone repository post-commit not appear in ..clonefolder/.git/hooks repository.

May be this functions need to be register via cmd?

Can somebody help how rightly create/add new hook functions?

Jack
  • 514
  • 3
  • 11
  • 30
Stanislav Machel
  • 349
  • 2
  • 20
  • 2
    Possible duplicate of [Can Git hook scripts be managed along with the repository?](http://stackoverflow.com/questions/427207/can-git-hook-scripts-be-managed-along-with-the-repository) – LeGEC Feb 05 '16 at 12:51

1 Answers1

3

Hooks are not versioned with a repo, and will not get cloned.

You can put the files somewhere in your base repo directory, and put symlinks from .git/hook to these files, but you will need to execute this setup step each time a new clone is made.

You may want to symlink the whole .git/hook directory, as suggested by several other answers :

for example

LeGEC
  • 46,477
  • 5
  • 57
  • 104