Skip to content

Commit

Permalink
Update step content ot address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorsector committed Jan 26, 2024
1 parent 0cc1af8 commit 252ba05
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/steps/1-removing-sensitive-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ See [Deleting a file on GitHub Docs](https://docs.github.com/en/repositories/wor

### :keyboard: Activity: Remove `.env` in the project root directory

1. Open your terminal of choice and clone this repository.
1. Open your terminal of choice, clone this repository, and switch to your repository directory.
```shell
git clone <your-repository-url>
cd <your-repository-name>
```
2. Delete `.env` from the root directory.
```shell
Expand Down
6 changes: 3 additions & 3 deletions .github/steps/2-removing-with-bfg.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ _You removed `.env` from the repository's root directory! :tada:_

Now that we've deleted the file, people that browse the repository on GitHub.com or anyone looking at just the head commit won't see the file. However, due to Git's nature, the file is still present in the history. In this step, we'll work on removing the file from the repository history.

**What is a _head commit_**?: In Git, HEAD points to a branch or a commit. When we say [head commit](https://docs.github.com/en/get-started/quickstart/github-glossary#head), we usually mean the most recent commit in the repository's history.
**What is a _head commit_**? In Git, HEAD points to a branch or a commit. When we say [head commit](https://docs.github.com/en/get-started/quickstart/github-glossary#head), we usually mean the most recent commit in the repository's history.

There are multiple tools available for removing Git history, we'll use BFG Repo-Cleaner in this step. You can find additional documentation on [Using the BFG in GitHub Docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository#using-the-bfg).

**What is _BFG Repo-Cleaner_**?: BFG Repo-Cleaner is software that can help you search through and alter repository history. Git can natively do this using [`git filter-repo`](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository#using-git-filter-repo), but it can be more complex.
**What is _BFG Repo-Cleaner_**? BFG Repo-Cleaner is software that can help you search through and alter repository history. Git can natively do this using [`git filter-repo`](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository#using-git-filter-repo), but it can be more complex.

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

Expand All @@ -36,7 +36,7 @@ There are multiple tools available for removing Git history, we'll use BFG Repo-
bfg --delete-files .env
```
6. The tool will run and make some suggestions about some follow-up commands. Run those to get your local repository cleaned up.
7. Repeat the sarch for .env in the repository's history. This time, the command should return empty.
7. Repeat the search for `.env` in the repository's history. This time, the command should return empty.
```shell
git log --stat --all -- .env
```
Expand Down
2 changes: 1 addition & 1 deletion .github/steps/3-avoiding-future-commits.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The steps we've taken so far ensure that any _new_ clones of the repository don'

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.
We'll now configure Git so it ignores a future addition of sensitive content by adding `.env` to `.gitignore`. If someone should that file 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).

Expand Down

0 comments on commit 252ba05

Please sign in to comment.