Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
セキュリティのために
.gitignoreファイルを活用しようときおり、GitHubにチェックインしたくないファイルがあるかと思います。機密情報などといったプッシュするべきではない情報を含んでいるファイルは無視したいと思うかもしれません。Gitにファイルを無視するよう伝えるにはいくつか方法があります。
ファイルを無視する
Gitはコミットする際に
.gitignoreというファイルを使ってどのファイルやディレクトリを無視するか決定します。設定ファイルやenvファイルのような機密情報が含まれたファイルをリポジトリの対象から外すことが出来ます。これはセキュリティのベストプラクティスを促進する1つのやり方です。
.gitignoreファイルはリポジトリにコミットする必要があります。このファイルを共有しコードの一部とすることで、他の人の役にも立ちます。リポジトリにコントリビュートしている他のユーザーが機密情報をコミットしてしまうことも防ぐことができるのです。皆さんのリポジトリで使えるような.gitignoreのサンプルが沢山あります。そういったサンプルはgitignoreリポジトリで見つけることが出来ます。ステップ5:ファイルを無視する
このプルリクエストでは、
.gitignoreファイルを追加しています。.envで終わるファイルは一般的には機密情報を含んでいます。こうすることで、機密情報を含むファイルを安全で秘密に保つことが出来ます。これらのファイルを.gitignoreに追加してみましょう。⌨️ やってみよう:.gitignoreファイルの更新
...の中のEdit fileをクリックし、.gitignoreを編集.envと追記このコースの手順はQuick Reference Guideにもまとまっています。
完了したら、次のコメントをこのプルリクエストに書きます。