Gistrec

Git hook - don't push to master

Oct 3rd, 2018
339
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.20 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. changedBranch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
  4.  
  5. if [ $changedBranch == "master" ]; then
  6.     echo "You are not allowed commit changes in this branch"
  7.     exit 1
  8. fi
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment