Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add recipes exercise to each chapter #239

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions chapters/branches.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,36 @@ Preserve merge commits during the rebase.
Automatically squash commits marked with "squash" or "fixup" in their commit message during an interactive rebase.
:::

## Exercises

::: {.panel-tabset}

### {{< fa utensils >}} Recipes

::: {.callout-note title="Exercises" collapse="true" appearance="simple"}
{{< include ../exercises/_exercises-branches.qmd >}}
:::

::: {.callout-tip title="Solutions" collapse="true" appearance="simple"}
```{zsh, filename="Code"}
#| eval: false
#| file: code/code-exercises-branches.sh
```
{{< include ../exercises/_solutions-branches.qmd >}}
:::

::: {.callout-tip title="Command history" collapse="true" appearance="simple"}
```{zsh, filename="Output"}
#| code-copy: false
#| eval: false
#| file: exercises-repos/history-branches.txt
```
:::

[Download the repository](../exercises-repos/recipes-branches.zip){.btn .btn-outline-primary role="button"}

:::

## Acknowledgements & further reading

We would like to express our gratitude to the following resources, which have been essential in shaping this chapter.
Expand Down
41 changes: 41 additions & 0 deletions chapters/command-line.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,47 @@ If you're interested in delving deeper, you may find a more comprehensive introd

!["Hackerman" meme found on [Reddit.com](https://www.reddit.com/r/meme/comments/fu9f3b/command_prompt/)](../static/cli_meme.jpg){#fig-meme}

## Exercises

::: {.panel-tabset}

### {{< fa utensils >}} Recipes

::: {.callout-note title="Exercises" collapse="true" appearance="simple"}
{{< include ../exercises/_exercises-cli.qmd >}}
:::

::: {.callout-tip title="Solutions" collapse="true" appearance="simple"}

```{zsh filename="Code"}
cd /path/to/your/chosen/directory # <1>
```
1. Navigate into the chosen location.
Replace `/path/to/your/chosen/directory` with a path on your computer.
A good location might be within your `/Documents` folder or a dedicated `/Projects` or `/University` folder.
This can help to easily find course-related files on your computer.

```{zsh, filename="Code"}
#| eval: false
#| file: code/code-exercises-cli.sh
```
{{< include ../exercises/_solutions-cli.qmd >}}
:::

::: {.callout-tip title="Command history" collapse="true" appearance="simple"}
```{zsh, filename="Output"}
#| code-copy: false
#| eval: false
#| file: exercises-repos/history-cli.txt
```
:::

::: {.callout-note title="Variation - Longer version + Solutions" collapse="true" appearance="simple"}
{{< include ../exercises/_exercises-cli-long.qmd >}}
:::
[Download the folder](../exercises-repos/recipes-cli.zip){.btn .btn-outline-primary role="button"}
:::

## Acknowledgements & further reading

We would like to express our gratitude to the following resources, which have been essential in shaping this chapter.
Expand Down
33 changes: 33 additions & 0 deletions chapters/first-steps-git.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,39 @@ Modifies the previous commit.
It allows you to add new changes to the previous commit or modify its commit message.
:::

## Exercises

::: {.panel-tabset}

### {{< fa utensils >}} Recipes

::: {.callout-note title="Exercises" collapse="true" appearance="simple"}
{{< include ../exercises/_exercises-first-steps-git.qmd >}}
:::

::: {.callout-tip title="Solutions" collapse="true" appearance="simple"}
```{zsh, filename="Code"}
#| eval: false
#| code-line-numbers: true
#| code-overflow: scroll
#| file: code/code-exercises-first-steps-git.sh
```
{{< include ../exercises/_solutions-first-steps-git.qmd >}}
:::

::: {.callout-tip title="Command history" collapse="true" appearance="simple"}
```{zsh, filename="Output"}
#| code-copy: false
#| eval: false
#| code-line-numbers: true
#| code-overflow: scroll
#| file: exercises-repos/history-first-steps-git.txt
```
:::

[Download the repository](../exercises-repos/recipes-first-steps.zip){.btn .btn-outline-primary role="button"}

:::

## Cheatsheet

Expand Down
15 changes: 15 additions & 0 deletions chapters/github-advanced.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,21 @@ Some prominent alternative include [GitLab](https://about.gitlab.com/de-de/), [B
Potential disadvantages of GitHub include limited free private repositories, privacy concerns and a potential vendor lock in.
On the other hand there are also advantages to GitHub, for example it's user-friendly interface, the rich ecosystem and it's extensive integration to third-party tools.

## Exercises

::: {.panel-tabset}

### {{< fa utensils >}} Recipes

::: {.callout-note title="Exercises" collapse="true" appearance="simple"}
{{< include ../exercises/_exercises-github-advanced.qmd >}}
:::

::: {.callout-tip title="Solutions" collapse="true" appearance="simple"}
{{< include ../exercises/_solutions-github-advanced.qmd >}}
:::
:::

## Acknowledgements

```{r}
Expand Down
15 changes: 15 additions & 0 deletions chapters/gui.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@ For a more comprehensive tutorial on using Git in Rstudio you can check out the
You should keep in mind that while the RStudio GUI simplifies many Git tasks, it lacks the flexibility and customization of using the command line.
But considering you can also open a command line tab in RStudio, the GUI might be a help in your workflow, if you work on a {{< fa brands r-project >}} project and track it using Git.

## Exercises
::: {.panel-tabset}

### {{< fa utensils >}} Recipes

::: {.callout-note title="Exercises" collapse="true" appearance="simple"}
{{< include ../exercises/_exercises-gui.qmd >}}
:::

::: {.callout-tip title="Solutions" collapse="true" appearance="simple"}
{{< include ../exercises/_solutions-gui.qmd >}}
:::
:::


## Acknowledgements & further reading

```{r}
Expand Down
26 changes: 9 additions & 17 deletions chapters/installation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ abstract: |

::: {.callout-tip appearance="minimal"}
<h5>Learning Objectives</h5>

{{< include ../objectives/_objectives-installation.qmd >}}
:::

Expand All @@ -24,8 +25,7 @@ The Terminal can be found at `/Applications/Utilities/Terminal.app` or by search
If you are unsure where to find the terminal, we recommend to read the ["Command Line"](command-line.qmd) chapter beforehand.
:::

MacOS usually comes with a pre-installed version of Git that is accessible through the Xcode Command Line Tools.
Open the Terminal and type:
MacOS usually comes with a pre-installed version of Git that is accessible through the Xcode Command Line Tools. Open the Terminal and type:

```{bash}
git --version
Expand All @@ -37,8 +37,7 @@ If Git is installed, you should receive an output similar to:
git version 2.39.2 (Apple Git-143)
```

If Git is not installed you will get a prompt asking you if you wish to install it along with Xcode command line tools.
You also may be asked for your administrator password.
If Git is not installed you will get a prompt asking you if you wish to install it along with Xcode command line tools. You also may be asked for your administrator password.

::: {.callout-caution title="Error message: `xcrun: error`" collapse="true"}
**Problem**
Expand All @@ -55,8 +54,7 @@ xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools
xcode-select --install
```

This will open a dialogue box.
Select "Install", and it will download and install the [Command Line Tools](https://developer.apple.com/library/archive/technotes/tn2339/_index.html) package and fix the problem.
This will open a dialogue box. Select "Install", and it will download and install the [Command Line Tools](https://developer.apple.com/library/archive/technotes/tn2339/_index.html) package and fix the problem.
:::

#### Option 2: Binary installer
Expand All @@ -65,24 +63,19 @@ Download and run the installer from: <https://git-scm.com/download/mac>. Hit `Co

### {{< fa brands windows >}} Windows

To use Git on a Windows computer, we recommend the installation of "[Git for Windows](https://gitforwindows.org/)", which includes both the Bash shell and Git.
You can download this program at [gitforwindows.org](https://gitforwindows.org/).
To use Git on a Windows computer, we recommend the installation of "[Git for Windows](https://gitforwindows.org/)", which includes both the Bash shell and Git. You can download this program at [gitforwindows.org](https://gitforwindows.org/).

[![Screenshot of gitforwindows.org](../static/git_bash_website.png){#fig-git_bash_website width="500"}](https://gitforwindows.org)

On the homepage, you should see a prominent download link.

Click on it to start downloading the installer.
Once the installer is downloaded, double-click it to run the installation.
During the installation process, you'll be presented with various options and settings.
We recommend to leave all settings to their standard configuration, unless you have a specific need to e.g. change the installation destination.
Click on it to start downloading the installer. Once the installer is downloaded, double-click it to run the installation. During the installation process, you'll be presented with various options and settings. We recommend to leave all settings to their standard configuration, unless you have a specific need to e.g. change the installation destination.

![](../static/git_bash_inst_2.png){width="200"} ![](../static/git_bash_inst_3.png){width="200"}![](../static/git_bash_inst_4.png){width="200"} ![](../static/git_bash_inst_5.png){width="200"} ![](../static/git_bash_inst_6.png){width="200"} ![](../static/git_bash_inst_7.png){width="200"} ![](../static/git_bash_inst_8.png){width="200"} ![](../static/git_bash_inst_9.png){width="200"} ![](../static/git_bash_inst_10.png){width="200"} ![](../static/git_bash_inst_11.png){width="200"} ![](../static/git_bash_inst_12.png){width="200"} ![](../static/git_bash_inst_13.png){width="200"}

Once you have finished selecting your preference, click the install button to begin the installation process.

The installer will copy the necessary files and set up Git and Git Bash on your system.
Once the installation is complete, you'll see a "Finish" button and the option to directly launch a Bash window.
The installer will copy the necessary files and set up Git and Git Bash on your system. Once the installation is complete, you'll see a "Finish" button and the option to directly launch a Bash window.

![](../static/git_bash_inst_14.png){width="300"} ![](../static/git_bash_inst_15.png){width="300"}

Expand All @@ -106,8 +99,7 @@ sudo apt-get install git

## Acknowledgements and further reading

We would like to express our gratitude to the following resources, which have been essential in shaping this chapter.
We recommend these references for further reading:
We would like to express our gratitude to the following resources, which have been essential in shaping this chapter. We recommend these references for further reading:

```{r}
#| eval: true
Expand All @@ -117,4 +109,4 @@ We recommend these references for further reading:
#| output: asis
bibtexkeys = c("bryan2023", "capes2023", "chacon2014", "koziar2023")
knitr::kable(ref_table(bibtexkeys), format = "markdown")
```
```
15 changes: 15 additions & 0 deletions chapters/remotes-intro.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,21 @@ Coming soon!

:::

## Exercises

::: {.panel-tabset}

### {{< fa utensils >}} Recipes

::: {.callout-note title="Exercises" collapse="true" appearance="simple"}
{{< include ../exercises/_exercises-github-intro.qmd >}}
:::

::: {.callout-tip title="Solutions" collapse="true" appearance="simple"}
{{< include ../exercises/_solutions-github-intro.qmd >}}
:::
:::

## Acknowledgements

```{r}
Expand Down
29 changes: 29 additions & 0 deletions chapters/setup.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,35 @@ There is no required order, we only want to make sure Git works as expected and

Thanks to [Eamon Caddigan](https://social.coop/@eamon/112434377857903339) for this tip!

## Exercises

::: {.panel-tabset}

### {{< fa utensils >}} Recipes

::: {.callout-note title="Exercises" collapse="true" appearance="simple"}
{{< include ../exercises/_exercises-setup.qmd >}}
:::

::: {.callout-tip title="Solutions" collapse="true" appearance="simple"}
```{zsh, filename="Code"}
#| eval: false
#| file: code/code-exercises-setup.sh
```
{{< include ../exercises/_solutions-setup.qmd >}}
:::

::: {.callout-tip title="Command history" collapse="true" appearance="simple"}
```{zsh, filename="Output", echo = seq(4, 18)}
#| code-copy: false
#| eval: false
#| file: exercises-repos/history-setup.txt
```
:::

[Download the repository](../exercises-repos/recipes-setup.zip){.btn .btn-outline-primary role="button"}
:::

## Acknowledgements and further reading

We would like to express our gratitude to the following resources, which have been essential in shaping this chapter.
Expand Down
16 changes: 16 additions & 0 deletions chapters/tags-and-releases.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,22 @@ When you click on it there should be a section called **Markdown** with Markdown

You can copy and paste this syntax into your `README.md` file on GitHub to create a clickable DOI badge.


## Exercises

::: {.panel-tabset}

### {{< fa utensils >}} Recipes

::: {.callout-note title="Exercises" collapse="true" appearance="simple"}
{{< include ../exercises/_exercises-stashing.qmd >}}
:::

::: {.callout-tip title="Solutions" collapse="true" appearance="simple"}
{{< include ../exercises/_solutions-stashing.qmd >}}
:::
:::

## Acknowledgements and further reading

We would like to express our gratitude to the following resources, which have been essential in shaping this chapter.
Expand Down
Loading