#!/usr/bin/env bash | |
LC_ALL=C | |
# Place this in .git/hooks/post-checkout | |
local_branch="$(git rev-parse --abbrev-ref HEAD)" | |
if [[ $local_branch == "master" ]] | |
then | |
echo "===============================================" | |
echo "There is something wrong with your branch name." | |
echo " We no longer use the master branch." | |
echo " *** Moving you to main branch instead ***" | |
echo "===============================================" | |
git checkout main | |
git branch -d master | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment