0
0

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.

GitHubへパスワード関連データをpushするのを防ぐ

Last updated at Posted at 2020-12-13

git-secrets

pushしようとしたコードをチェックし、パスワードだと推定されるような文字列が含まれている場合はそこで処理が中断される仕組み

インストール

% brew install git-secrets

適用

アプリケーションディレクトリで下記を実行

% git secrets --install

以下のコマンドで一括設定可能

% git secrets --register-aws --global

設定内容は以下のコマンドで確認可能

% git secrets --list

以下のコマンドで、今後作成する全てのリポジトリにgit-secretsが適用される。
作成中のアプリディレクトrで実行すること

% git secrets --install ~/.git-templates/git-secrets
% git config --global init.templatedir '~/.git-templates/git-secrets'

※GitHub Desktop経由の際に利用する場合の追加設定

% sudo cp /usr/local/bin/git-secrets /Applications/GitHub\ Desktop.app/Contents/Resources/app/git/bin/git-secrets
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?