Open mfechner opened 8 years ago
I've done this via an init/templatedir in ~/.gitconfig. But: #3753 .
@stroucki would you share documentation how to do that?
previously I create /usr/share/git-core/templates/hooks/post-receive
and it work, but after some gogs
updates it doesn't work anymore
Here is my .gitconfig.
[user]
email = gogs@fake.local
name = Gogs
[core]
quotepath = false
[init]
templatedir = /home/git/git-template
The git-template directory has the initial contents for a new git repository:
/home/git/git-template/
/home/git/git-template/branches
/home/git/git-template/hooks
/home/git/git-template/hooks/prepare-commit-msg.sample
/home/git/git-template/hooks/applypatch-msg.sample
/home/git/git-template/hooks/post-update.sample
/home/git/git-template/hooks/commit-msg.sample
/home/git/git-template/hooks/pre-rebase.sample
/home/git/git-template/hooks/pre-applypatch.sample
/home/git/git-template/hooks/pre-push.sample
/home/git/git-template/hooks/update.sample
/home/git/git-template/hooks/pre-receive
/home/git/git-template/hooks/pre-commit.sample
/home/git/git-template/info
/home/git/git-template/info/exclude
/home/git/git-template/description
I apparently used pre-receive to call up my policy script.
@biji see above
It would be a nice feature if you can define hooks that should be used by default for a newly created repository, e.g. a post-receive hook with content: