After a flurry of accidental pushes direct to the main branch at work, I decided we need a technical solution. The obvious answer would be to use GitLab’s protected branches, but that’s not practical at our org. Next best: a #githook to check the branch one is committing to, and have the user confirm or cancel as the case may be.
Continue reading “Collect a keypress in a bash githook”