Closed spinwang closed 7 years ago
It needs to be on the PATH somewhere where the client can find it.
Does this comment help you? If so, we can see about adding this to the readme: https://github.com/awslabs/git-secrets/issues/46.
@mtdowling after running that command, it works now. I think it's a good idea to add it to documentation. Thanks!
How do you remove this error when uninstalling git secrets?
Is there anyway to undo the things this tool does to a repository?
you need to remove the git-secrets from a repo hooks: repo_name/.git/hooks and delete git secrets from these 3 files: commit-msg -> git secrets --commit_msg_hook -- "$@" pre-commit -> git secrets --pre_commit_hook -- "$@" prepare-commit-msg -> git secrets --prepare_commit_msg_hook -- "$@"
You will have to do this for every repository created after install of git-secrets
#!/usr/bin/env bash
# Recursively remove references to "git secrets" from webhooks in all repositories
find . -regex '.*/\.git/hooks/commit-msg' -exec sed -i '' -e 's/git secrets --commit_msg_hook -- "$@"//' {} \;
find . -regex '.*/\.git/hooks/pre-commit' -exec sed -i '' -e 's/git secrets --pre_commit_hook -- "$@"//' {} \;
find . -regex '.*/\.git/hooks/prepare-commit-msg' -exec sed -i '' -e 's/git secrets --prepare_commit_msg_hook -- "$@"//' {} \;
The above script does uninstall all git-secrets
commands hooks in all existing git folders. But cloning the new repo might add those commands again. You need to remove git-secrets in .git-templates
as well.
$ cd ~/.git-templates
$ rm -rf git-secrets
It needs to be on the PATH somewhere where the client can find it.
Does this comment help you? If so, we can see about adding this to the readme: #46.
Thanks. But what does "it" refer to? "git"? "git secrets"? "secrets"? Sorry, but I probably would not here at all if I knew more.
I followed the instructions in the readme and can use the git CLI to commit without any problem, but when I use github mac desktop tool, I always get the following error during commit:
git: 'secrets' is not a git command.