2
1

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 5 years have passed since last update.

IntelliJのコミット時の'secrets' is not a git commandを解決する

Last updated at Posted at 2019-10-06

クレデンシャルを公開しないようにしてくれるgit-secretsは便利ですが、IDEで追加設定をしないと使えない場合があります。

問題

MacでIntelliJを使用時、git-secretsで管理されているフォルダでコミットすると、以下のようなエラーでコミットできません。

0 files committed, 1 file failed to commit: add gatling sample git: 'secrets' is not a git command. See 'git --help'.

解決

原因は、intelliJのgit実行のパスにあります。デフォルトだと/usr/bin/gitを使用します。

一方、macのbrewでgit-secretsを入れた場合は、git-secretsパスは/usr/local/bin/になるので、デフォルトだと見てくれません。

そこで、gitの実行パスを変えましょう。

IntelliJで Preference → Version Control → Git と行き、
Path to Git executableのパスを/usr/local/bin/gitと変更しApplyします。

image.png

無事コミットできればOKです。

参考

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?