GIT Hack: Prevent pushing to master

 4 years ago
source link: https://blog.ghost.org/prevent-master-push/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Git has this great feature whereby you can execute arbitrary scripts whenever something happens on your git repository. A common use case for this is a pre-receive hook on the remote repository which prevents people with access from doing destructive actions, like force pushing, which are incredibly easy to do

About Joyk

Aggregate valuable and interesting links.
Joyk means Joy of geeK