Integrate secretlint with global git hooks.
Prevent credentials on any Git project by secretlint.
- Global Git Hooks using
core.hooksPath
on Git 2.9+ - If project has setup local git hook, call local hooks too
- Order: local hooks -> global hooks
- Define ignoring project paths by
IGNORE_GLOBAL_HOOKS
file
pre-commit
- secretlint prevent to commit credentials
Requirement:
- Docker
- Git 2.9+
Check if you already have any global git hooks:
git config --global core.hooksPath
If output is not empty, run following steps:
# clone this repository
git clone https://github.com/secretlint/git-hooks git-hooks
cd git-hooks
# setup git config
git config --global core.hooksPath $(pwd)/hooks
You can create IGNORE_GLOBAL_HOOKS
file in git-hooks project dir.
It is collection of absolute path to ignore global hooks.
IGNORE_GLOBAL_HOOKS
:
/path/to/my-project-a
/path/to/my-project-b
If the project path is included in IGNORE_GLOBAL_HOOKS
, global git hook does not run.
Use --no-verify
options.
git commit --no-verify
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT © azu