You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/making_a_change/index.qmd
+45-16Lines changed: 45 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -9,34 +9,63 @@ title: Making a change
9
9
* Make a small change to your site.
10
10
* See how that change appears in the live preview.
11
11
* Save your work with a Git commit.
12
+
* Understand where the commit is pushed to.
12
13
13
14
:::
14
15
15
16
## Make a small change
16
17
17
18
1. Open the file `1_making_a_change.qmd`.
18
19
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.
20
21
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.
24
23
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?
28
25
29
26
## Save your change with Git
30
27
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
+
{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
+
{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
+
{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:
37
66
38
-
1. Click on the Source Control button in the sidebar.
67
+
{fig-alt="Screenshot of cursor hovering over the Repositories button."}
39
68
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.
41
70
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.
0 commit comments