mirror of
https://codeberg.org/vlw/dotfiles.git
synced 2026-01-11 21:36:00 +01:00
14 lines
No EOL
358 B
Bash
14 lines
No EOL
358 B
Bash
#!/bin/bash
|
|
|
|
# Get the current branch name
|
|
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
|
|
|
# Check if the current branch is master
|
|
if [[ "$current_branch" == "master" ]]; then
|
|
read -p "You are about to commit to the master branch. Do you want to continue? (y/n) " -n 1 -r
|
|
echo
|
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
echo "Commit aborted."
|
|
exit 1
|
|
fi
|
|
fi |