- Make a copy this directory
- Remove the
.git
directory - Follow the rest of this README's instructions
- Feel free to add some information about the basic usage, pros and cons etc.
- Install pre-commit: https://pre-commit.com/#install
- Install Talisman: https://thoughtworks.github.io/talisman/docs/installation
- Install detect-secrets: https://github.com/Yelp/detect-secrets/#installation
# Initialize Git:
git init
# Install pre-commit hooks:
pre-commmit install -f
# Try doing the initial commit (both Talisman and detect-secrets
# pre-commit hooks should make it fail):
git add .
git commit -m "Initial commit"
# Resolve by:
# 1. Adjusting and configure Talisman's `.talismanrc` file (see CLI output)
# 2. Creating baseline file for detect-secrets using this command:
detect-secrets scan --all-files > .secrets.baseline
# Try doing the initial commit (should be successful now):
git add .
git commit -m "Initial commit"
In case you want to use the tools outside of git hooks.
# Talisman:
talisman -p "./**/*.{java}"
# detect-secrets
detect-secrets scan src --all-files
# detect-secrets for specific file while using the baseline file
detect-secrets-hook --baseline .secrets.baseline src/main/java/org/example/Main.java