Use terminal to navigate into the root folder of your repository
Execute command
curl -o pre-commit https://raw.githubusercontent.com/viktor-mazepa/git-hooks/main/gitleaks-precommit.sh && chmod +x pre-commit && \
mv pre-commit .git/hooks && \
mkdir .git-scripts && \
curl -o .git-scripts/pre-commit.go https://raw.githubusercontent.com/viktor-mazepa/git-hooks/main/scripts/pre-commit.go && \
echo ".git-scripts/*" >> .gitignore
Try to commit token/secret. Enjoy!
Use PowerShell to navigate into the root folder of your repository
Execute command
curl -o pre-commit https://raw.githubusercontent.com/viktor-mazepa/git-hooks/main/gitleaks-precommit.sh ; `
mv pre-commit .git\hooks ; mkdir .git-scripts ; `
curl -o .git-scripts\pre-commit.go https://raw.githubusercontent.com/viktor-mazepa/git-hooks/main/scripts/pre-commit.go ; `
echo ".git-scripts/*" >> .gitignore
Try to commit token/secret. Enjoy!