5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

SourceTreeを使用して git: 'secrets' is not a git command. See 'git --help'. エラー解決方法

Posted at

環境

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 を使用する」)
スクリーンショット 2020-10-10 15.29.57.png
自分の場合は/usr/local/Cellar/git/2.13.1/bin/gitの指定になっていたのが問題のようでした。

参考記事
【Git】git: 'secrets' is not a git command. See 'git --help'.というエラーがでたときの解決方法
AWSアクセスキーをGitリポジトリに混入させないために git-secrets を導入した

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?