awslabs / git-secrets

Prevents you from committing secrets and credentials into git repositories
Apache License 2.0
12.36k stars 1.17k forks source link

git: 'secrets' is not a git command on github mac desktop #52

Closed spinwang closed 7 years ago

spinwang commented 7 years ago

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.

mtdowling commented 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.

spinwang commented 7 years ago

@mtdowling after running that command, it works now. I think it's a good idea to add it to documentation. Thanks!

kalexmills commented 5 years ago

How do you remove this error when uninstalling git secrets?

Is there anyway to undo the things this tool does to a repository?

rezabekf commented 5 years ago

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

markokeeffe commented 5 years ago

For those uninstalling 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 -- "$@"//' {} \;
techministrator commented 2 years ago

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
jmcbri commented 2 weeks 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: #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.