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.
Removing the previous
.env
file from the branch is great, but it's reactive. We need to ensure future contributions don't include sensitive files by mistake. We can do this by adding a.gitignore
file to our repository.Taking advantage of the
.gitignore
fileFrom time to time, there are files you don't want Git to check in to GitHub. You may want to ignore files that contain sensitive credentials or information which should not be pushed to your repository. There are a few ways to tell Git which files to ignore.
Ignoring files
Git uses a file called
.gitignore
to decide which files and directories to ignore when committing. Keep files containing sensitive data, like configuration or.env
files, out of your repositories. This is one way to promote security best practices.The
.gitignore
file can, and should, be committed into your repository. By sharing this file and making it part of your code, future contributors to the repository will avoid committing sensitive data. There are many examples of.gitignore
files available for you to use in your own repositories. You can find them in the gitignore repository.Step 10: Add a
.gitignore
fileIn this pull request, I'm adding a
.gitignore
file. Files ending with.env
commonly include sensitive data. This helps you keep files with sensitive data secure and private. Let's add those files to the.gitignore
.⌨️ Activity: Updating the .gitignore file
...
) in the right upper corner and click Edit file to edit the.gitignore
file..env
to line 1.Return to this pull request for my next comment.