Skip to content

Instantly share code, notes, and snippets.

@sevenmaxis
Last active July 15, 2019 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sevenmaxis/eb8232b7ed7fd66ad0f807c6fa09c995 to your computer and use it in GitHub Desktop.
Save sevenmaxis/eb8232b7ed7fd66ad0f807c6fa09c995 to your computer and use it in GitHub Desktop.
# cd into project
# To bypass this hook, pass --no-verify or -n option
# Pre-push hook
echo -e '#!/bin/bash\ngit ls-files -m | xargs ls -1 2>/dev/null | xargs rubocop' > .git/hooks/pre-push
# Pre-commit commit
echo -e '#!/bin/bash\nrubocop' > .git/hooks/pre-push
chmod +x .git/hooks/pre-push
chmod +x .git/hooks/pre-commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment