Skip to content

Commit

Permalink
add remaining content steps
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorsector committed Jan 12, 2024
1 parent 286878c commit d433c27
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 172 deletions.
25 changes: 23 additions & 2 deletions .github/steps/2-tbd.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,26 @@ There are multiple tools available for removing Git history, we'll use BFG Repo-

### :keyboard: Activity: Use BFG Repo-Cleaner to remove the `.env` file

1. TBD-step-2-instructions.
1. 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.
1. Install BFG Repo-Cleaner on your machine. You can follow the [instructions on the web site](https://rtyley.github.io/bfg-repo-cleaner/) to do so or you can use a package manager for your operating system.
2. Run each of the following commands to confirm the state of the repository:

```shell
# Confirm .env is removed
# Expected return: empty
find . -name ".env"

# Search for .env in the repository's history
# Expected return: 2 commits from adding and then removing .env
git log --stat --all -- .env
```

3. Run the following command to delete all references to `.env` that exist in the repository.
```shell
bfg --delete-files .env
```
4. The tool will run and make some suggestions about some follow-up commands. Run those to get your local repository cleaned up.
5. Push your changes to GitHub. Note we're using the `--force` argument in this step since we're altering Git history.
```shell
git push --force
```
6. 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.
17 changes: 13 additions & 4 deletions .github/steps/3-tbd.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,24 @@
TBD-step-3-notes.
-->

## Step 3: TBD-step-3-name
## Step 3: Avoiding future commits with `.env`

_Nice work finishing TBD-step-2-name :sparkles:_

TBD-step-3-information
In a real-life scenario, you'd ask anyone with a copy of the repository to delete it and clone the repository fresh. In a real 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.

For our next step, we'll configure Git so it ignores a future addition of the `.env` file. 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 _TBD-term-3_**: TBD-definition-3

### :keyboard: Activity: TBD-step-3-name

1. TBD-step-3-instructions.
1. 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.
1. Locate the file we added to the repository titled `.gitignore`.
2. Add `.env` to the file.
3. Stage, commit, and push the file to GitHub:
```shell
git add .gitignore
git commit -m "ignore .env files"
git push
```
4. 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.
19 changes: 0 additions & 19 deletions .github/steps/4-tbd.md

This file was deleted.

17 changes: 0 additions & 17 deletions .github/steps/5-tbd.md

This file was deleted.

65 changes: 0 additions & 65 deletions .github/workflows/4-tbd.yml

This file was deleted.

65 changes: 0 additions & 65 deletions .github/workflows/5-tbd.yml

This file was deleted.

0 comments on commit d433c27

Please sign in to comment.