- Move file "pre-commit" under project to 14_pre_commit_hook\.git\hooks.
- Open file and change <path_to_test> to real path where tests are situated.
For example:
python D:\project\14_pre_commit_hook\tests.py - Save the file.
- Under project folder run (to get the permissions and only once):
chmod +x .git/hooks/pre-commit - Do some changes in any file and in command line run:
git add file_name.py
git commit -m "some changes" - If tests pass, changes will be committed. If tests fail, commit will be canceled.
mkravchenko / 14_pre_commit_hook Goto Github PK
View Code? Open in Web Editor NEWThis project forked from devmanorg/14_pre_commit_hook