Skip to content

Instantly share code, notes, and snippets.

@ento
Created April 5, 2011 05:57
Show Gist options
  • Save ento/903098 to your computer and use it in GitHub Desktop.
Save ento/903098 to your computer and use it in GitHub Desktop.
Steps to install pep8 pre-commit hook managed by git-hooks
# Repository developers
cd /path/to/somewhere
git clone https://github.com/kergoth/git-hooks
export PATH=/path/to/somewhere/git-hooks:$PATH
cd /path/to/project
git hooks --install
# Repository owner
cd /path/to/project
mkdir -p git_hooks/pre-commit
curl -o git_hooks/pre-commit/check_pep8.py https://gist.github.com/raw/810399/7e5e122f3956c023afd68c6a1e0e177bfad11b9e/gistfile1.py
chmod a+x git_hooks/pre-commit/check_pep8.py
# check the hook is installed correctly
git hooks
# commit the hook
git add git_hooks/pre-commit/check_pep8.py
git commit -m "add pre-commit hook to check pep8"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment