How to prevent git from pushing commits that contain given string in commit massage, e.g. "DO NOT PUSH" ?
Context/usecase:
My typical workflow is: I hack hack, splitting work into micro commits, once things work I rewrite history, changing order of commit to group them reasonably and later squashing into bigger meaningful pieces. Once work is ready, things are ready to push!
Now I would like git to prevent me from accidentally pushing into repository commits that are still in progress.
I considered keeping "DO NOT PUSH" as part of commit message.
How to make git automatically prevent me from pushing when it reaches such commit after git push
?
(On for pre-receive hook solutions: let's consider github as example service, which AFAIK does not allow pre-recevie hooks, except in its "Enterprise" edition)