tree: 70c70273929914a00a4b1a6cc0af538f2bb42228 [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 $GOPATH/src/github.com/apache/trafficcontrol/ directory, create a symbolic link from the pre-commit executable in this directory to the .git/hooks/ directory:

ln -s ../../misc/git/pre-commit .git/hooks/

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