Skip to content

Commit 59f4ab9

Browse files
brabojclaude
andcommitted
fix: add blank lines in exercises for proper list rendering
MkDocs requires a blank line between a paragraph and a numbered list. Without it, Steps and Verify sections rendered as a single paragraph. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6242a14 commit 59f4ab9

3 files changed

Lines changed: 112 additions & 28 deletions

File tree

docs/01-Introduction/07-exercises.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ in this chapter if you get stuck. Do not skip the verification steps.
88
**Task:** Confirm that Git is installed and check which version you are running.
99

1010
**Steps:**
11+
1112
1. Open a terminal (PowerShell on Windows, a shell on Linux/macOS)
1213
2. Run the command to display the installed Git version
1314
3. Run the command to display the built-in help overview
1415

15-
**Verify:** The version command prints a line starting with `git version` followed by
16+
**Verify:**
17+
18+
The version command prints a line starting with `git version` followed by
1619
a version number. The help command prints a list of common Git commands grouped
1720
by category.
1821

@@ -24,12 +27,15 @@ by category.
2427
you make.
2528

2629
**Steps:**
30+
2731
1. Set your global user name using `git config`
2832
2. Set your global email address using `git config`
2933
3. Read back both values to confirm they are stored correctly
3034
4. Display the full list of configuration settings with `git config --list`
3135

32-
**Verify:** The read-back commands print exactly the name and email you entered.
36+
**Verify:**
37+
38+
The read-back commands print exactly the name and email you entered.
3339
Both entries also appear in the `--list` output.
3440

3541
---
@@ -39,6 +45,7 @@ Both entries also appear in the `--list` output.
3945
**Task:** Initialise a brand-new local Git repository and make your first commit.
4046

4147
**Steps:**
48+
4249
1. Create a new directory called `git-exercises` and enter it
4350
2. Initialise a Git repository inside the directory
4451
3. Create a file called `hello.txt` with some text in it
@@ -47,7 +54,9 @@ Both entries also appear in the `--list` output.
4754
6. Check the status again to see the file is staged
4855
7. Commit the staged file with the message `Add hello.txt`
4956

50-
**Verify:** Running `git log` shows one commit with the message `Add hello.txt`.
57+
**Verify:**
58+
59+
Running `git log` shows one commit with the message `Add hello.txt`.
5160
Running `git status` reports a clean working tree with nothing to commit.
5261

5362
---
@@ -59,6 +68,7 @@ index, and local repository — by making a change and moving it through
5968
the pipeline.
6069

6170
**Steps:**
71+
6272
1. Inside the `git-exercises` repository, edit `hello.txt` and add a second line
6373
2. Run `git status` to see the file listed as modified (workspace)
6474
3. Run `git diff` to see the exact change
@@ -68,7 +78,9 @@ the pipeline.
6878
7. Commit the change with a descriptive message
6979
8. Run `git log` to confirm the new commit appears in the local repository
7080

71-
**Verify:** `git status` reports a clean working tree. `git log` shows two commits
81+
**Verify:**
82+
83+
`git status` reports a clean working tree. `git log` shows two commits
7284
in chronological order.
7385

7486
---
@@ -79,6 +91,7 @@ in chronological order.
7991
object contents, and repository status.
8092

8193
**Steps:**
94+
8295
1. Run `git log` to see the full commit history
8396
2. Run `git log --oneline` to see a compact view
8497
3. Copy the short hash of the first commit from the oneline output
@@ -87,7 +100,9 @@ object contents, and repository status.
87100
6. Note the tree hash printed in the output, then run `git cat-file -p <tree-hash>`
88101
to list the files recorded in that commit
89102

90-
**Verify:** The `-t` command prints `commit`. The `-p` command on the commit shows
103+
**Verify:**
104+
105+
The `-t` command prints `commit`. The `-p` command on the commit shows
91106
author, committer, tree hash, and the commit message. The `-p` command on the tree
92107
lists the `hello.txt` blob.
93108

@@ -99,6 +114,7 @@ lists the `hello.txt` blob.
99114
repository, and push your commits.
100115

101116
**Steps:**
117+
102118
1. Sign in to GitHub (or another hosting service from the reference page)
103119
2. Create a new empty repository named `git-exercises` — do not add a README
104120
or any other files
@@ -109,6 +125,8 @@ repository, and push your commits.
109125
6. Push the local commits to the remote with `git push -u origin main`
110126
7. Refresh the repository page in the browser
111127

112-
**Verify:** The hosting service shows all committed files and the full commit
128+
**Verify:**
129+
130+
The hosting service shows all committed files and the full commit
113131
history matches what `git log` displays locally. Running `git branch -av`
114132
shows both the local and remote branch pointing to the same commit.

docs/02-Concepts/17-exercises.md

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ All exercises use a fresh, disposable repository unless stated otherwise.
1010
**Task:** Initialize a new Git repository and explore its internal structure.
1111

1212
**Steps:**
13+
1314
1. Create a new directory called `concepts-lab` and navigate into it
1415
2. Run `git init` to create a repository
1516
3. List the contents of the `.git` directory
@@ -18,7 +19,9 @@ All exercises use a fresh, disposable repository unless stated otherwise.
1819
6. Create a bare repository called `concepts-lab.git` in a sibling directory using `git init --bare`
1920
7. Compare the directory structure of the bare repository with the `.git` folder
2021

21-
**Verify:** The `.git` directory exists and contains `objects`, `refs`, `HEAD`, and `config`. The bare repository has the same internal structure but no working tree.
22+
**Verify:**
23+
24+
The `.git` directory exists and contains `objects`, `refs`, `HEAD`, and `config`. The bare repository has the same internal structure but no working tree.
2225

2326
---
2427

@@ -27,6 +30,7 @@ All exercises use a fresh, disposable repository unless stated otherwise.
2730
**Task:** Set user name and email at the local and global levels and observe which one takes precedence.
2831

2932
**Steps:**
33+
3034
1. Inside `concepts-lab`, set a global user name and email using `git config --global`
3135
2. Set a different local user name and email using `git config --local`
3236
3. Run `git config --list --show-origin` to see all active settings and their sources
@@ -35,7 +39,9 @@ All exercises use a fresh, disposable repository unless stated otherwise.
3539
6. Remove the local overrides using `git config --local --unset user.name` and `git config --local --unset user.email`
3640
7. Make another commit and verify the global identity is now used
3741

38-
**Verify:** The first commit shows the local identity. The second commit shows the global identity. `git config --list --show-origin` displays both levels and marks which file each setting comes from.
42+
**Verify:**
43+
44+
The first commit shows the local identity. The second commit shows the global identity. `git config --list --show-origin` displays both levels and marks which file each setting comes from.
3945

4046
---
4147

@@ -44,6 +50,7 @@ All exercises use a fresh, disposable repository unless stated otherwise.
4450
**Task:** Create blobs, trees, and commits, then inspect them with plumbing commands.
4551

4652
**Steps:**
53+
4754
1. In `concepts-lab`, create a file called `hello.txt` with the content `Hello, Git!`
4855
2. Stage the file with `git add hello.txt`
4956
3. Run `git ls-files --stage` and note the blob hash next to the file name
@@ -55,7 +62,9 @@ All exercises use a fresh, disposable repository unless stated otherwise.
5562
9. Verify that the tree references the same blob hash from step 3
5663
10. Browse the `.git/objects` directory and locate the two-character subdirectory matching the first two characters of the blob hash
5764

58-
**Verify:** `git cat-file -p` on the blob prints `Hello, Git!`. The tree object lists the blob hash with mode `100644` and file name `hello.txt`. The corresponding object file exists on disk under `.git/objects`.
65+
**Verify:**
66+
67+
`git cat-file -p` on the blob prints `Hello, Git!`. The tree object lists the blob hash with mode `100644` and file name `hello.txt`. The corresponding object file exists on disk under `.git/objects`.
5968

6069
---
6170

@@ -64,6 +73,7 @@ All exercises use a fresh, disposable repository unless stated otherwise.
6473
**Task:** Create both tag types and compare how Git stores them internally.
6574

6675
**Steps:**
76+
6777
1. In `concepts-lab`, make sure you have at least one commit
6878
2. Create a lightweight tag called `v0.1` using `git tag v0.1`
6979
3. Create an annotated tag called `v1.0` with the message `First release` using `git tag -a v1.0 -m "First release"`
@@ -73,7 +83,9 @@ All exercises use a fresh, disposable repository unless stated otherwise.
7383
7. Run `git cat-file -t` on both hashes and compare the object types
7484
8. Run `git cat-file -p` on the annotated tag hash and inspect the tagger, date, message, and target reference
7585

76-
**Verify:** The lightweight tag hash points directly to a commit object (`git cat-file -t` prints `commit`). The annotated tag hash points to a tag object (`git cat-file -t` prints `tag`), which in turn references the commit.
86+
**Verify:**
87+
88+
The lightweight tag hash points directly to a commit object (`git cat-file -t` prints `commit`). The annotated tag hash points to a tag object (`git cat-file -t` prints `tag`), which in turn references the commit.
7789

7890
---
7991

@@ -82,6 +94,7 @@ All exercises use a fresh, disposable repository unless stated otherwise.
8294
**Task:** Use the index to selectively stage changes and observe its contents.
8395

8496
**Steps:**
97+
8598
1. In `concepts-lab`, create two files: `tracked.txt` and `experimental.txt`
8699
2. Stage only `tracked.txt` with `git add tracked.txt`
87100
3. Run `git ls-files --stage` to see what is in the index
@@ -92,7 +105,9 @@ All exercises use a fresh, disposable repository unless stated otherwise.
92105
8. Run `git ls-files --stage` a final time and confirm only `tracked.txt` remains
93106
9. Commit the staged file
94107

95-
**Verify:** After step 7, `git ls-files --stage` shows only `tracked.txt`. After the commit, `git status` shows `experimental.txt` as untracked and the working tree is otherwise clean.
108+
**Verify:**
109+
110+
After step 7, `git ls-files --stage` shows only `tracked.txt`. After the commit, `git status` shows `experimental.txt` as untracked and the working tree is otherwise clean.
96111

97112
---
98113

@@ -101,6 +116,7 @@ All exercises use a fresh, disposable repository unless stated otherwise.
101116
**Task:** Practice the full branch lifecycle and observe how references change.
102117

103118
**Steps:**
119+
104120
1. In `concepts-lab`, confirm you are on the `main` branch with `git branch`
105121
2. Read `.git/refs/heads/main` and note the commit hash
106122
3. Create a new branch called `feature/greeting` using `git branch feature/greeting`
@@ -112,7 +128,9 @@ All exercises use a fresh, disposable repository unless stated otherwise.
112128
9. Read `.git/refs/heads/main` and confirm it still points to the original commit
113129
10. Switch back to `main` and delete the branch with `git branch -d feature/greeting`
114130

115-
**Verify:** After deletion, the file `.git/refs/heads/feature/greeting` no longer exists. `git branch` lists only `main`. The commit created on the feature branch becomes unreachable.
131+
**Verify:**
132+
133+
After deletion, the file `.git/refs/heads/feature/greeting` no longer exists. `git branch` lists only `main`. The commit created on the feature branch becomes unreachable.
116134

117135
---
118136

@@ -121,6 +139,7 @@ All exercises use a fresh, disposable repository unless stated otherwise.
121139
**Task:** Create a merge conflict, inspect the conflict markers, and resolve it manually.
122140

123141
**Steps:**
142+
124143
1. In `concepts-lab`, create a file `config.txt` with the line `mode=production` and commit it on `main`
125144
2. Create and switch to a branch `feature/debug` using `git switch -c feature/debug`
126145
3. Change the line in `config.txt` to `mode=debug` and commit
@@ -132,7 +151,9 @@ All exercises use a fresh, disposable repository unless stated otherwise.
132151
9. Edit `config.txt` to resolve the conflict by choosing one value or combining them
133152
10. Stage the resolved file with `git add config.txt` and complete the merge with `git commit`
134153

135-
**Verify:** After the merge commit, `git log --oneline --graph` shows the two branches converging. `git ls-files --stage` shows a single stage-0 entry for `config.txt`. The file contains the resolved content with no conflict markers.
154+
**Verify:**
155+
156+
After the merge commit, `git log --oneline --graph` shows the two branches converging. `git ls-files --stage` shows a single stage-0 entry for `config.txt`. The file contains the resolved content with no conflict markers.
136157

137158
---
138159

@@ -141,6 +162,7 @@ All exercises use a fresh, disposable repository unless stated otherwise.
141162
**Task:** Use the stash to save uncommitted changes, switch branches, then restore them.
142163

143164
**Steps:**
165+
144166
1. In `concepts-lab`, make sure you are on `main` with a clean working tree
145167
2. Create a file `notes.txt` with the content `Work in progress`
146168
3. Stage the file with `git add notes.txt`
@@ -152,7 +174,9 @@ All exercises use a fresh, disposable repository unless stated otherwise.
152174
9. Restore the stashed changes with `git stash pop`
153175
10. Confirm `notes.txt` is back in the working tree and staged
154176

155-
**Verify:** After `git stash pop`, `git status` shows `notes.txt` as a staged new file. `git stash list` is empty.
177+
**Verify:**
178+
179+
After `git stash pop`, `git status` shows `notes.txt` as a staged new file. `git stash list` is empty.
156180

157181
---
158182

@@ -161,6 +185,7 @@ All exercises use a fresh, disposable repository unless stated otherwise.
161185
**Task:** Stage only some changes from a single file to make a focused commit.
162186

163187
**Steps:**
188+
164189
1. In `concepts-lab`, create a file `multi.txt` with three lines: `line1`, `line2`, `line3` and commit it
165190
2. Modify the file so that `line1` becomes `LINE1` and `line3` becomes `LINE3` (leave `line2` unchanged)
166191
3. Run `git diff` to confirm both hunks appear
@@ -170,7 +195,9 @@ All exercises use a fresh, disposable repository unless stated otherwise.
170195
7. Commit the staged hunk
171196
8. Stage and commit the remaining change
172197

173-
**Verify:** `git log --oneline` shows two separate commits. Running `git diff HEAD~1 HEAD~2` shows only the `line1` change. Running `git diff HEAD HEAD~1` shows only the `line3` change.
198+
**Verify:**
199+
200+
`git log --oneline` shows two separate commits. Running `git diff HEAD~1 HEAD~2` shows only the `line1` change. Running `git diff HEAD HEAD~1` shows only the `line3` change.
174201

175202
---
176203

@@ -179,6 +206,7 @@ All exercises use a fresh, disposable repository unless stated otherwise.
179206
**Task:** Apply a simplified Git Flow workflow using branches and merges.
180207

181208
**Steps:**
209+
182210
1. Create a fresh repository called `flow-lab` and navigate into it
183211
2. Create an initial commit on `main` with a file `app.txt` containing `v1.0`
184212
3. Create a `develop` branch from `main` and switch to it
@@ -191,4 +219,6 @@ All exercises use a fresh, disposable repository unless stated otherwise.
191219
10. Delete the release branch
192220
11. Run `git log --oneline --graph --all` to visualize the full history
193221

194-
**Verify:** `main` and `develop` both contain the `v1.1` change and the `login.txt` file. The tag `v1.1` exists and points to the merge commit on `main`. The feature and release branches are deleted. The graph shows the expected merge topology.
222+
**Verify:**
223+
224+
`main` and `develop` both contain the `v1.1` change and the `login.txt` file. The tag `v1.1` exists and points to the merge commit on `main`. The feature and release branches are deleted. The graph shows the expected merge topology.

0 commit comments

Comments
 (0)