amarao: (Default)
[personal profile] amarao
Пушить нельзя, а коммитить локально можно. В очередной раз промахнувшись бранчем и вынужденный делать 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

Date: 2023-11-11 09:47 am (UTC)
yurikhan: (Default)
From: [personal profile] yurikhan

В Magit’е есть специальная команда spinoff, чтобы (1) создать новую фиче-ветку с локального master’а, и (2) вернуть локальный master на origin/master.

Profile

amarao: (Default)
amarao

February 2026

S M T W T F S
123456 7
8910111213 14
15161718192021
22232425262728

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 25th, 2026 06:28 pm
Powered by Dreamwidth Studios