Hook before commit #2442

Closed
opened 2025-11-02 04:36:18 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @pjebs on GitHub (Oct 24, 2018).

If we want to restrict the types of files of what gets committed (i.e. say we only want *.MD), is there a hook we can intercept at and prevent a commit if the file type is wrong?

Originally created by @pjebs on GitHub (Oct 24, 2018). If we want to restrict the types of files of what gets committed (i.e. say we only want *.MD), is there a hook we can intercept at and prevent a commit if the file type is wrong?
Author
Owner

@Etzelia commented on GitHub (Oct 24, 2018):

Yes, pre-receive.
I believe update as well, but pre-receive is probably a better option.
https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

@Etzelia commented on GitHub (Oct 24, 2018): Yes, pre-receive. I believe update as well, but pre-receive is probably a better option. https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2442