環境
macOS 10.15.6
git 2.23.0
SourceTreeでコミット使用とした際に以下のエラー画面が表示された
git: 'secrets' is not a git command. See 'git --help'.
いろいろ調べたのですが、方法としては
そもそもgit-secretsがインストールされていない可能性
brew install git-secrets
自分の場合は下の結果が表示され既にインストール済みと
Warning: git-secrets 1.3.0 is already installed and up-to-date
次に指定したgitと同じパスにgit-secretsを置くこと
自分は置いていたのですが、うまくいかず...
$ which git
/usr/local/bin/git
$ which git-secrets
/usr/local/bin/git-secrets
次にSourceTreeの設定でそもそもgitの指定が間違っている
/usr/local/bin/gitを指定する(環境設定 > Git > 「システムの Git を使用する」)
自分の場合は/usr/local/Cellar/git/2.13.1/bin/gitの指定になっていたのが問題のようでした。
参考記事
【Git】git: 'secrets' is not a git command. See 'git --help'.というエラーがでたときの解決方法
AWSアクセスキーをGitリポジトリに混入させないために git-secrets を導入した