Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .githooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# `.githooks` directory

Because the `.git\hooks` is invisible and therefor harder to add to the repo the following construct is made. All hooks are part of the repo and are located in the `.githooks` directory, which can be committed.

To notify git to look in the `.githooks` directory, execute the following:

```
git config core.hooksPath .githooks
```

If you want this behavior for all repos:
```
git config --global core.hooksPath .githooks
```
6 changes: 6 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$branch" = "main" ]; then
echo "No commits on man branch allowed"
exit 1
fi