Skip to content

Commit

Permalink
Merge branch 'main' into issue-607
Browse files Browse the repository at this point in the history
  • Loading branch information
erinmgraham authored Jan 10, 2025
2 parents dad68fc + 9bc5ac5 commit 9c4f669
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 25 deletions.
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Instances of abusive, harassing, or otherwise unacceptable behavior
may be reported by following our [reporting guidelines][coc-reporting].


[coc-reporting]: https://docs.carpentries.org/topic_folders/policies/incident-reporting.html
[coc]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html
[coc-reporting]: https://docs.carpentries.org/policies/coc/incident-reporting.html
[coc]: https://docs.carpentries.org/policies/coc/
6 changes: 3 additions & 3 deletions episodes/02-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ If you elect to use a private email address with GitHub, then use GitHub's no-re

## Line Endings

As with other keys, when you hit <kbd>Enter</kbd> or <kbd>↵</kbd> or on Macs, <kbd>Return</kbd> on your keyboard,
As with other keys, when you press <kbd>Enter</kbd> or <kbd>↵</kbd> or on Macs, <kbd>Return</kbd> on your keyboard,
your computer encodes this input as a character.
Different operating systems use different character(s) to represent the end of a line.
(You may also hear these referred to as newlines or line breaks.)
Expand Down Expand Up @@ -111,8 +111,8 @@ It is possible to reconfigure the text editor for Git whenever you want to chang
## Exiting Vim

Note that Vim is the default editor for many programs. If you haven't used Vim before and wish to exit a session without saving
your changes, press <kbd>Esc</kbd> then type `:q!` and hit <kbd>Enter</kbd> or <kbd>↵</kbd> or on Macs, <kbd>Return</kbd>.
If you want to save your changes and quit, press <kbd>Esc</kbd> then type `:wq` and hit <kbd>Enter</kbd> or <kbd>↵</kbd> or on Macs, <kbd>Return</kbd>.
your changes, press <kbd>Esc</kbd> then type `:q!` and press <kbd>Enter</kbd> or <kbd>↵</kbd> or on Macs, <kbd>Return</kbd>.
If you want to save your changes and quit, press <kbd>Esc</kbd> then type `:wq` and press <kbd>Enter</kbd> or <kbd>↵</kbd> or on Macs, <kbd>Return</kbd>.


::::::::::::::::::::::::::::::::::::::::::::::::::
Expand Down
7 changes: 3 additions & 4 deletions episodes/04-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ You should be in the `recipes` directory.
$ cd ~/Desktop/recipes
```

Let's create a file called `guacamole.md` that contains the basic structure to
have a recipe.
Let's create a file called `guacamole.md` that contains the basic structure of a recipe.
We'll use `nano` to edit the file;
you can use whatever editor you like.
In particular, this does not have to be the `core.editor` you set globally earlier. But remember, the steps to create create or edit a new file will depend on the editor you choose (it might not be nano). For a refresher on text editors, check out ["Which Editor?"](https://swcarpentry.github.io/shell-novice/03-create.html#which-editor) in [The Unix Shell](https://swcarpentry.github.io/shell-novice/) lesson.
In particular, this does not have to be the `core.editor` you set globally earlier. But remember, the steps to create or edit a new file will depend on the editor you choose (it might not be nano). For a refresher on text editors, check out ["Which Editor?"](https://swcarpentry.github.io/shell-novice/03-create.html#which-editor) in [The Unix Shell](https://swcarpentry.github.io/shell-novice/) lesson.

```bash
$ nano guacamole.md
Expand Down Expand Up @@ -586,7 +585,7 @@ Two important facts you should know about directories in Git.
you can add all files in the directory at once by:

```bash
git add <directory-with-files>
$ git add <directory-with-files>
```

Try it for yourself:
Expand Down
26 changes: 12 additions & 14 deletions episodes/05-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ index b36abfd..0848c8d 100644
+An ill-considered change
```

Note that `HEAD` is the default option for `git diff`, so omitting it will not change the command's output at all (give it a try). However, the real power of `git diff` lies in its ability to compare with previous commits. For example, by adding `~1` (where "~" is "tilde", pronounced [**til**\-d*uh*]), we can look at the commit before `HEAD`.
Note that `HEAD` is the default option for `git diff`, so omitting it will not change the command's output at all (give it a try). However, the real power of `git diff` lies in its ability to compare with previous commits. For example, by adding `~1` (where "~" is "tilde", pronounced [**til**\-d*uh*]), we can look at the commit before `HEAD`.

```bash
$ git diff HEAD~1 guacamole.md
Expand Down Expand Up @@ -402,18 +402,18 @@ $ cat ketchup.md # this will print the content of ketchup.md on screen
```

1. ```output
ketchup enhances pasta dishes
```
ketchup enhances pasta dishes
```
2. ```output
I like tomatoes, therefore I like ketchup
```
I like tomatoes, therefore I like ketchup
```
3. ```output
I like tomatoes, therefore I like ketchup
ketchup enhances pasta dishes
```
I like tomatoes, therefore I like ketchup
ketchup enhances pasta dishes
```
4. ```output
Error because you have changed ketchup.md without committing the changes
```
Error because you have changed ketchup.md without committing the changes
```

::::::::::::::: solution

Expand All @@ -422,16 +422,14 @@ $ cat ketchup.md # this will print the content of ketchup.md on screen
The answer is 2.

The changes to the file from the second `echo` command are only applied to the working copy,
The command `git add ketchup.md` places the current version of `ketchup.md` into the staging area.
not the version in the staging area.
The command `git add ketchup.md` places the current version of `ketchup.md` into the staging area.

So, when `git commit -m "My opinions about the red sauce"` is executed,
the version of `ketchup.md` committed to the repository is the one from the staging area and
has only one line.

At this time, the working copy still has the second line (and

`git status` will show that the file is modified). However, `git restore ketchup.md`
At this time, the working copy still has the second line (and `git status` will show that the file is modified). However, `git restore ketchup.md`
replaces the working copy with the most recently committed version of `ketchup.md`.
So, `cat ketchup.md` will output

Expand Down
3 changes: 2 additions & 1 deletion episodes/06-ignore.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ You want to keep them but you do not want to track them through `git`.

:::::::::::::::::::::::::::::::::::::::: keypoints

- The `.gitignore` file tells Git what files to ignore.
- The .gitignore file is a text file that tells Git which files to track and which to ignore in the repository.
- You can list specific files or folders to be ignored by Git, or you can include files that would normally be ignored.

::::::::::::::::::::::::::::::::::::::::::::::::::

Expand Down
2 changes: 1 addition & 1 deletion episodes/07-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ computers to access your account.
We will run the list command to check what key pairs already exist on your computer.

```bash
ls -al ~/.ssh
$ ls -al ~/.ssh
```

Your output is going to look a little different depending on whether or not SSH has ever been set up on the computer you are using.
Expand Down

0 comments on commit 9c4f669

Please sign in to comment.