Skip to content

Instantly share code, notes, and snippets.

View sloev's full-sized avatar
https://www.buymeacoffee.com/sloev

sloev / Johannes Valbjørn sloev

https://www.buymeacoffee.com/sloev
View GitHub Profile
@sloev
sloev / git_pre_push_hook_to_prevent_master_push_by_accident.md
Last active February 28, 2022 20:10 — forked from ColCh/README.md
Git pre-push hook to confirm pushing to master

Git pre-push hook

It will check if current branch is master, then ask a confirmation, in case of master branch

install

  1. install a recent version of git (https://git-scm.com/download/mac) eg:

$ brew install git