Skip to content

Commit 1c95540

Browse files
Added pre-commit enforced branch protection. (#6)
1 parent 0b6df1a commit 1c95540

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.config/pre-commit.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@
1414
];
1515
};
1616

17+
# disallows commits to certain branches.
18+
no-commit-to-branch = {
19+
enable = true;
20+
settings.branch = [ "main" ];
21+
stages = [
22+
"pre-commit"
23+
"pre-push"
24+
"manual"
25+
];
26+
};
27+
1728
# Prevents committing binaries.
1829
check-added-large-files = {
1930
enable = true;

0 commit comments

Comments
 (0)