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?

1

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.