Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #18 from githubtraining/rename-branch
Browse files Browse the repository at this point in the history
rename the default branch in responses
  • Loading branch information
hectorsector authored Dec 1, 2020
2 parents 4514668 + 124aaa4 commit 72c5607
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ For more information on the goals of this course, check out the [`course-details

## Contribute

See something we could improve? Check out the contributing guide in the [community contributors repository](https://github.com/githubtraining/community-contributors/blob/master/CONTRIBUTING.md) for more information on the types of contributions we :heart: and instructions.
See something we could improve? Check out the contributing guide in the [community contributors repository](https://github.com/githubtraining/community-contributors/blob/main/CONTRIBUTING.md) for more information on the types of contributions we :heart: and instructions.

We :heart: our community and take great care to ensure it is fun, safe and rewarding. Please review our [Code of Conduct](https://github.com/githubtraining/community-contributors/blob/master/CODE_OF_CONDUCT.md) for community expectations and guidelines for reporting concerns.
We :heart: our community and take great care to ensure it is fun, safe and rewarding. Please review our [Code of Conduct](https://github.com/githubtraining/community-contributors/blob/main/CODE_OF_CONDUCT.md) for community expectations and guidelines for reporting concerns.

## License

Expand Down
4 changes: 2 additions & 2 deletions responses/00_introduction-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ This project is centered around a memory game that will be deployed with GitHub
1. Click the [**Settings**]({{ repoUrl }}/settings) tab in your repository.
1. Scroll down until you see **Data services**.
1. Under **Data services**, click the check boxes to enable all the data services.
2. Scroll down to **GitHub Pages** and set your [default branch as the source](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site), usually `main` or `master`.
2. Scroll down to **GitHub Pages** and set your [default branch as the source](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site), usually `main`.

{% else %}

### :keyboard: Activity: Enable GitHub Pages


1. Click the [**Settings**]({{ repoUrl }}/settings) tab in your repository.
1. Scroll down to **GitHub Pages** and set your [default branch as the source](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site), usually `main` or `master`.
2. Scroll down to **GitHub Pages** and set your [default branch as the source](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site), usually `main`.

{% endif %}

Expand Down
9 changes: 5 additions & 4 deletions responses/01_find-vulnerabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This repository has some existing dependencies which will need updating to stay
<summary>How can we identify dependencies and if they are vulnerable?</summary>
<hr>

This repository is a Node.js project utilizing NPM. Because of that, [`package.json`]({{ repoUrl }}/blob/master/package.json) defines this repository's dependencies. For our time together, we'll be focusing on these JavaScript dependencies. Keep in mind that different programming languages may have different dependency manifests. You might work with a `Gemfile`, `Gemfile.lock`, `*.gemspec`, `requirements.txt`, `pipfile.lock`, or other files.
This repository is a Node.js project utilizing NPM. Because of that, [`package.json`]({{ repoUrl }}/blob/main/package.json) defines this repository's dependencies. For our time together, we'll be focusing on these JavaScript dependencies. Keep in mind that different programming languages may have different dependency manifests. You might work with a `Gemfile`, `Gemfile.lock`, `*.gemspec`, `requirements.txt`, `pipfile.lock`, or other files.

How can we know these dependencies are secure? GitHub monitors a number of reputable [data sources](https://docs.github.com/en/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies#detection-of-vulnerable-dependencies) to track vulnerabilities across projects.

Expand All @@ -35,9 +35,10 @@ Use Dependabot alerts to identify a vulnerable NPM dependency.

1. Click the **Security** tab in your repository.
2. On the left hand navigation bar, click **Dependabot alerts**.
3. Click on the `debug` alert.
4. Take note of the suggested version.
5. Comment in this issue with the suggested update version.
3. Follow the instructions to enable Dependabot alerts, if they're not already enabled.
4. Click on the `debug` alert.
5. Take note of the suggested version.
6. Comment in this issue with the suggested update version.


> _**GitHub Enterprise Server only:** This is all possible on GitHub Enterprise through GitHub Connect. It may take up to an hour to refresh the alerts and make them visible. After waiting a reasonable amount of time, if you are still not seeing the yellow bar in the Dependency Graph, you may want to contact your administrator. In the mean time, to move along with the course, we'll give you a hint - the recommended upgraded version is `2.6.9`._
Expand Down
2 changes: 1 addition & 1 deletion responses/06_remove-sensitive-commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ We can do this by cloning this repository to our computer, and then running a fe
1. Clone this repository locally by running `git clone {{ repoUrl }}.git`
1. CD into your newly cloned repository with `cd security-strategy-essentials`
1. Checkout to the contributor's branch with `git checkout add-wolverine-image`
1. Remove the unwanted commit that introduced the `.env` file with a rebase. You can do this with `git rebase -i master` and then remove the entire commit so only the `Add wolverine image to game` commit remains
1. Remove the unwanted commit that introduced the `.env` file with a rebase. You can do this with `git rebase -i main` and then remove the entire commit so only the `Add wolverine image to game` commit remains
1. Run `git push -f` to force push your changes to the branch on GitHub

<hr>
Expand Down
10 changes: 5 additions & 5 deletions responses/11_correct-commit-id.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Nice, that's the commit that added the `.env` file. We'll need to remove the con

We can do this with the following commands:

1. Since we cloned the repository earlier, let's run `git checkout master` to put us back on the master branch
1. Since we cloned the repository earlier, let's run `git checkout main` to put us back on the main branch
1. Run `git pull` to update your local repository with the changes we merged from the contributor's pull request
1. Run `git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch .env" HEAD` to remove the historical reference to the `.env` file

**Note:** There is a lot going on with this command. We won't be diving into everything this command is doing, but it's filtering through the master branch and removing any cached reference to a `.env` file.
**Note:** There is a lot going on with this command. We won't be diving into everything this command is doing, but it's filtering through the main branch and removing any cached reference to a `.env` file.

1. Next, let's run `git push -f` to force push this change to the master branch
1. Next, let's run `git push -f` to force push this change to the main branch
1. Let's now run `git log --oneline` to get a list of our modified commit history
1. Paste your log output into this issue as a comment

Expand All @@ -19,9 +19,9 @@ We can do this with the following commands:
<hr>

```
d27dde6 (HEAD -> master, origin/master, origin/HEAD) Merge pull request #8 from {{ user.username }}/add-gitignore
d27dde6 (HEAD -> main, origin/main, origin/HEAD) Merge pull request #8 from {{ user.username }}/add-gitignore
65c1b71 Update .gitignore
a9b1b74 Merge add-wolverine-image into master
a9b1b74 Merge add-wolverine-image into main
e2262cd Add wolverine image to game
9414843 Merge pull request #6 from {{ user.username }}/a-a-ron-patch-1
16d5372 Create SECURITY.md
Expand Down
2 changes: 1 addition & 1 deletion responses/12_correct-references-removed.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is why you need to consider local work and branches that are based on this

### Is the sensitive information gone?

Those commits no longer show in the file contents in your repository history. You can see this by navigating to your <a href="{{ repoUrl }}/commits/master">repository's commit history</a> and clicking on the "Add .env file" commit. Notice that there are now no referenced files or content recorded.
Those commits no longer show in the file contents in your repository history. You can see this by navigating to your <a href="{{ repoUrl }}/commits/main">repository's commit history</a> and clicking on the "Add .env file" commit. Notice that there are now no referenced files or content recorded.

However, we can still access the cached commit if we know the old commit ID: {{ repoUrl }}/commit/848cd8c2043f6161a4f0043bffee212777281494

Expand Down

0 comments on commit 72c5607

Please sign in to comment.