Last active
June 28, 2020 21:35
-
-
Save Br3nda/c50b35ce01d83f17536264f67b61be25 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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