generated from skills/template-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5175596
commit e1e90b6
Showing
2 changed files
with
33 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!-- | ||
<<< Author notes: Step 3 >>> | ||
Start this step by acknowledging the previous step. | ||
Define terms and link to docs.github.com. | ||
TBD-step-3-notes. | ||
--> | ||
|
||
## Step 3: Avoiding future commits with `.env` | ||
|
||
_Nice work removing the file from entire history of the repository! :sparkles:_ | ||
|
||
The steps we've taken so far ensure that any _new_ clones of the repository don't contain the sensitive data. But what about collaborators that may already have a copy of the repository? You should ask anyone with a copy of the repository to delete it and clone the repository fresh. In a real-life scenario, you'd also take [additional steps](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository#fully-removing-the-data-from-github) to ensure no sensitive data is cached on GitHub.com. | ||
|
||
Now that we've mitigated the risk of exposing sensitive content, we'll be proactive and prevent its addition. | ||
|
||
We'll now configure Git so it ignores a future addition of sensitive content by adding the filename to `.gitignore`. If someone should add it to the local copy of their repository, it will remain only on the contributor's machine and won't be pushed to GitHub. | ||
|
||
**What is `.gitignore`?** This special file allows us to tell Git naming patterns to ignore. You can read more about it in [Ignoring files on GitHub Docs](https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files). | ||
|
||
### :keyboard: Activity: Add `.env` to `.gitignore` | ||
|
||
1. Locate the file we added to the repository titled `.gitignore`. | ||
2. Add `.env` to the file. | ||
3. Stage, commit the file: | ||
```shell | ||
git add .gitignore | ||
git commit -m "ignore .env files" | ||
``` | ||
4. Push the file to GitHub.com | ||
```shell | ||
git push | ||
``` | ||
5. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step. |
This file was deleted.
Oops, something went wrong.