Skip to content

Commit 97f6188

Browse files
committed
Update commit markdown
1 parent a5f5037 commit 97f6188

File tree

5 files changed

+19
-16
lines changed

5 files changed

+19
-16
lines changed

lessons/git-commit.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ You can think of a commit as a _snapshot_ of the instance of the codebase at a g
2121

2222
Internally, Git tracks these commits by creating an [Directed Acyclic Graph (DAG)](https://en.wikipedia.org/wiki/Directed_acyclic_graph), with every commit representing a node in the graph and every edge points back to the previous commit that occurred.
2323

24-
<div style="text-align: center;"><img src="commit.png" width="400px" alt=""></div>
24+
<div style="text-align: center; display: flex; justify-content: center;"><img src="learning-lab/images/lessons/git-commit/commit.png" width="400px" alt=""></div>
2525

2626
You may notice that each commit node may have more than one incoming edge. This is where the idea of **branching** stems from.
2727

28-
:::callout{.warning}
28+
:::callout{.warning.minimal}
2929
We will be discussing branching in a later lesson.
3030
:::
3131

@@ -35,15 +35,15 @@ By default, Git does not know what files it should be including in a snapshot (a
3535

3636
This is where the "three areas" concept comes into play. It is often good to think of your projects with Git as three separate concepts:
3737

38-
<div style="text-align: center;"><img src="staging.png" alt="" width="500px"></div>
38+
<div style="text-align: center; display: flex; justify-content: center;"><img src="learning-lab/images/lessons/git-commit/staging.png" alt="" width="500px"></div>
3939

4040
1. Working directory: where your codebase actually resides
4141
2. Staging area: set of files that you want to include in a snapshot
4242
3. Repository: local/remote repository storing metadata about the project and Git
4343

4444
By default, all of your files reside in the working directory and are not yet added to the staging area. If you want a file included in the staging area, then you must first add it to the staging area (we will cover how this happens later on).
4545

46-
:::callout{.info}
46+
:::callout{.info.minimal}
4747
There are also ways to remove files from the staging area!
4848
:::
4949

@@ -59,12 +59,17 @@ Create a new file in the folder and add some text to it.
5959
echo 'Hello world' >> hello.txt
6060
```
6161

62-
:::callout{.info}
62+
:::callout{.info.minimal}
6363
The command above essentially redirects the output of the `echo` (Hello world) into a new file `hello.txt`
6464
:::
6565

6666
If you don't want to use bash commands, you can just create the file using your preferred method as well.
6767

68+
::::exercises
69+
:::exercise{name="grocery-shopping" recommendation="Must do"}
70+
:::
71+
::::
72+
6873
### Getting the status of a repository
6974

7075
Now, run the following command to view the status of your repository.
@@ -89,7 +94,7 @@ nothing added to commit but untracked files present (use "git add" to track)
8994

9095
Recall that in [Adding files to a snapshot](./#adding-files-to-a-snapshot "mention"), Git does not automatically add files to a snapshot as it does not know exactly what you want. So we want to tell Git that we want `hello.txt` in the snapshot.
9196

92-
:::callout{.info}
97+
:::callout{.info.minimal}
9398
`git status` is to view the state of your repository in Git's eyes. Use it to view things like the current files in the snapshot.
9499

95100
You may find exercises for it [here](https://github.com/git-mastery/problems-directory?tab=readme-ov-file#git-status).
@@ -107,7 +112,7 @@ As discussed in [What is a commit](./#what-is-a-commit "mention"), a file from t
107112

108113
To add `hello.txt` to the staging area, use the following command:
109114

110-
:::callout{.warning}
115+
:::callout{.warning.minimal}
111116
We will be covering what `git add` does in a later lesson.
112117
:::
113118

@@ -143,6 +148,6 @@ git commit -m "First commit"
143148

144149
The `-m` flag is used to specify the commit message. Every commit has an accompanying message that you can use to indicate what the commit contains/entails.
145150

146-
:::callout{.info}
151+
:::callout{.info.minimal}
147152
If you do not use `-m`, your favorite terminal/GUI editor will be launched and you can compose the commit message in that editor, save it, and close the editor
148153
:::
19.1 KB
Loading
18.1 KB
Loading

src/plugins/remark-exercises.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const remarkExercises: Plugin<[], Root> = () => {
3939
{
4040
className: "exercise-bar",
4141
},
42-
mdParagraph(`Exercise${exercises.length > 1 ? "s" : ""}`, {
42+
mdParagraph(`✏️ Exercise${exercises.length > 1 ? "s" : ""}`, {
4343
className: "exercise-title",
4444
}),
4545
),
@@ -83,12 +83,6 @@ const remarkExercises: Plugin<[], Root> = () => {
8383
),
8484
),
8585
);
86-
console.log(
87-
mdLink(
88-
"More details about exercise",
89-
`https://github.com/git-mastery/grocery-shopping`,
90-
),
91-
);
9286
parent.children[index] = wrapper;
9387
}
9488
});

src/styles/markdown-layout.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ div.exercises div.exercise-bar p.exercise-title {
121121
}
122122

123123
div.exercises div.exercise {
124-
@apply rounded-md border-1 border-neutral-300;
124+
@apply rounded-md border-1 border-neutral-300 ml-6;
125125
}
126126

127127
div.exercises div.exercise div.exercise-metadata {
@@ -146,3 +146,7 @@ div.exercises div.exercise div.exercise-content {
146146
div.exercises div.exercise div.exercise-description {
147147
@apply mt-2 pt-2 border-t-1 border-t-neutral-200;
148148
}
149+
150+
img {
151+
@apply my-4;
152+
}

0 commit comments

Comments
 (0)