Skip to content

Instantly share code, notes, and snippets.

@Createdd
Last active September 15, 2018 14:59
Show Gist options
  • Select an option

  • Save Createdd/93a8582bde38112ede09e08beb889970 to your computer and use it in GitHub Desktop.

Select an option

Save Createdd/93a8582bde38112ede09e08beb889970 to your computer and use it in GitHub Desktop.
#!/bin/sh
echo "$branchName"
if [ "$branchName" = "master" ]; then
exit 0
fi
if [[ "$branchName" =~ ^[a-z]+[\/]+[A-Z]+[\-]+[0-9]+[\_]+[a-zA-Z] ]]; then
echo "Good branch name!"
exit 0
else
echo "Rename with 'git branch -m <newBranchName>'"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment