Skip to content

Commit 3ad3918

Browse files
committed
feat(making_a_change): finished writing page
1 parent 338800b commit 3ad3918

7 files changed

Lines changed: 80 additions & 16 deletions

File tree

41.1 KB
Loading

pages/making_a_change/index.qmd

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,63 @@ title: Making a change
99
* Make a small change to your site.
1010
* See how that change appears in the live preview.
1111
* Save your work with a Git commit.
12+
* Understand where the commit is pushed to.
1213

1314
:::
1415

1516
## Make a small change
1617

1718
1. Open the file `1_making_a_change.qmd`.
1819

19-
2. Add a short line of text in the body - for example:
20+
2. Add a short line of text in the body - for example `This is my new sentence.` You don't need to save - Codespace auto-saves any changes.
2021

21-
```{.markdown}
22-
This is my change.
23-
```
22+
3. Click the <kbd>Preview</kbd> button - this will update your site with new changes, if you still have it open, or re-open it, with new changes.
2423

25-
3. If the preview is still running: just save your files; the browser should refresh automatically. If it is not running, re-open it using the <kbd>Preview</kbd> button or by running `quarto preview` in the Terminal.
26-
27-
Does the page show your updated title and text?
24+
4. Check: Does the page show your updated title and text?
2825

2926
## Save your change with Git
3027

31-
We are working on github codespaces.
32-
github... versionl control...
33-
multiple copeis over time...
34-
Do so using commit.
35-
A commit is like a snapshot of your project at a particular moment in time. When you commit, Git records what changed, who changed it, and a short message describing the change.
36-
We are going to commit our change.
28+
We are working in GitHub Codespaces, which uses **Git** for version control. Version control means Git keeps track of how your files change over time, so you can see what you changed, when you changed it, and go back if you make a mistake.
29+
30+
A commit is like a snapshot of your project at a particular moment. A commit records:
31+
32+
* Which files changed
33+
* Exactly what changed
34+
* Who made the change and a short message describing it
35+
36+
Now we will make a commit for the change you just made.
37+
38+
1. Click on the **Source Control** button in the sidebar.
39+
40+
![](source_control.drawio.png){fig-alt="Screenshot of VSCode sidebar with Source Control button circled."}
41+
42+
2. In the Source Control panel, you should see your changed file listed. Hover over the file, and click the <kbd>+</kbd> button. This is called staging the file: you are telling Git "include this file in my next commit".
43+
44+
![](stage_changes.drawio.png){fig-alt="Screenshot of cursor hovering over the '+' button"}
45+
46+
3. At the top of the Source Control panel, there is a box labelled Message. Type a short description of what you did, for example: `Made a change to a file`. Then click the blue <kbd>✓ Commit</kbd> button. This creates the commit: Git saves a snapshot of your project with your message attached.
47+
48+
![](commit_message.png){fig-alt="Screenshot showing a commit message has been written."}
49+
50+
4. After committing, you will see the button now says <kbd>Sync changes 1 ↑</kbd>. Click this to send your commit from Codespaces up to GitHub. This means your snapshot now lives safely in your GitHub repository as well as in the Codespace.
51+
52+
## Repositories and forks
53+
54+
To explain what just happened, we need two ideas: repository and fork.
55+
56+
* A **repository** (often shortened to "repo") is a project folder that Git is tracking. It contains your files and the history of commits.
57+
* A **fork** is your own copy of someone else's GitHub repository. It lives under your GitHub account, so you are free to experiment without changing the original project.
58+
59+
In this tutorial you started from the `pythonhealthdatascience/quarto-template` repository, but you are working in **your fork** of that template. When you commit in Codespaces and sync, the commit is saved in the Codespace and then it is pushed to your fork on GitHub.
60+
61+
See your changes on GitHub...
62+
63+
1. In your browser, open GitHub (<https://github.com/>).
64+
65+
2. Go to your repoisitories by clicking your icon in the top right corner and then <kbd>Repositories</kbd> - for example:
3766

38-
1. Click on the Source Control button in the sidebar.
67+
![](repo.png){fig-alt="Screenshot of cursor hovering over the Repositories button."}
3968

40-
2. Click + for file changed.
69+
3. There, you should see `quarto-template` listed - this is your fork of the repository. Click on the title to open it.
4170

42-
3. Write a short message e.g., "Made a change to a file."
71+
4. Click the **Commits** link near the top to view the list of commits. Your latest commit (with the message you wrote) should appear at the top.

pages/making_a_change/repo.png

14.9 KB
Loading

pages/making_a_change/source_control.drawio

Lines changed: 19 additions & 0 deletions
Large diffs are not rendered by default.
174 KB
Loading

pages/making_a_change/stage_changes.drawio

Lines changed: 16 additions & 0 deletions
Large diffs are not rendered by default.
117 KB
Loading

0 commit comments

Comments
 (0)