We can ensure that we don't push code that puts the workspace in an invalid state, by adding a git hook to our workspace, that executes the check command.
To make this work, all developers should add .git/hooks/commit-msg to the root of the workspace on their local disk with the following content, e.g.: