Created
March 27, 2013 20:25
-
-
Save Fedalto/5257702 to your computer and use it in GitHub Desktop.
Git hook to make a git repository master branch read only. This should go in .git/hooks/
This file contains 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 ruby | |
old_sha1, new_sha1, ref = gets.split | |
if ref == "refs/heads/master": | |
puts "Pushing to origin/master is not permitted." | |
puts "This is a read-only branch." | |
puts "" | |
puts "Create a new branch instead, or commit to SVN." | |
exit 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment