Nov. 11th, 2023

amarao: (Default)
Пушить нельзя, а коммитить локально можно. В очередной раз промахнувшись бранчем и вынужденный делать git branch -D master, я набрался attention span и сделал прекоммит хук, чтобы такое запретить: .git/hooks/pre-commit:

#!/bin/sh
branch="$(git rev-parse --abbrev-ref HEAD)"
if [ "$branch" = "master" ]; then
echo "Direct commits to master branch are not allowed."
exit 1
fi

Profile

amarao: (Default)
amarao

May 2026

S M T W T F S
     12
3 4 567 89
101112 13141516
17181920 2122 23
242526 27282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 27th, 2026 08:10 pm
Powered by Dreamwidth Studios