tree: 96d6d3539721fb472abd8e901f068b0f15ca5c5b [path history] [tgz]
  1. pre-commit-hooks/
  2. pre-commit
  3. README.md
misc/git/README.md

Related files for use with this project and git.

Hooks

A collection of useful pre-commit hooks can be found in the pre-commit-hooks directory.

Installing pre-commit hooks

In the github.com/Comcast/traffic_control/.git/hooks directory, create a symbolic link to the pre-commit executable contained in this directory.

cd github.com/Comcast/traffic_control/.git/hooks
ln -s ../../misc/git/pre-commit .

Now, all executables in the pre-commit-hooks directory will be run on commit.

Adding pre-commit check

Once the pre-commit file is in place, all executables in the pre-commit-hooks directory will be run. Simply add an executable there. Exiting with non-zero status from this script causes the git commit to abort (the commit contents will be unaffected).

Skipping

To commit without running the hooks, use the no-verify flag.

git commit --no-verify