I noticed some patterns, that developers tend to do - like committing javascript tests with fdescribe
or fit
left in them (which means only one test/suite will be running), usually that is found in review phase, but it would be nice to catch those small things earlier. Wondering if there is a way to configure git to prevent commit if some pattern is detected within the changes?
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
That's a classical job for git commit hooks (
man githooks
); for example, from the standard script samples that you get in.git/hooks
, you can add a scriptpre-push
to that folder (make it executable!).This example script from the git project only checks the commit names, but if you replace the
line with something like
and grep for your suspcious strings, e.g.
you can make this happen for your case.