Skip to content

Commit 6b882be

Browse files
committed
updating presentation 2 with theatre analogy and made a few minor changes to some of the other slides to suit my narrative
1 parent 75bc225 commit 6b882be

File tree

9 files changed

+73
-32
lines changed

9 files changed

+73
-32
lines changed

assets/git-cycle/git-cycle-01.jpg

88.9 KB
Loading

assets/git-cycle/git-cycle-02.jpg

104 KB
Loading

assets/git-cycle/git-cycle-03.jpg

105 KB
Loading

assets/git-cycle/git-cycle-04.jpg

98.8 KB
Loading

assets/git-cycle/git-cycle-05.jpg

106 KB
Loading

assets/git-cycle/git-cycle-06.jpg

132 KB
Loading

assets/git-cycle/git-cycle-07.jpg

144 KB
Loading

assets/git-cycle/git-cycle-08.jpg

220 KB
Loading

version_control/_02_content.qmd

Lines changed: 73 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -255,38 +255,81 @@ gitGraph
255255

256256
So we've looked at the idea of bundling up changes as [commits]{.extra}, but what does that actually involve?
257257

258-
I think of it like packing a picnic basket:
258+
I like to think of a theatre, where the files are the cast waiting in the wings...
259259

260-
:::: {.box-ly}
260+
::: {#fig-cycle-01}
261+
![](../assets/git-cycle/git-cycle-01.jpg)
262+
:::
261263

262-
::: {.incremental}
263-
1. I make a sandwich and wrap it up
264-
2. I add it to the basket
265-
3. I chop up some fruit and put it in a lunchbox
266-
4. I add *that* to the basket
267-
5. I make a smoothie and bottle it
268-
6. I add *that* to the basket too
269-
7. Finally, I close over the top of the picnic basket and secure the latch
264+
## The `git` cycle: `add` {.smaller}
265+
266+
`git add filename` adds a file to the staging area...
267+
268+
::: {#fig-cycle-02}
269+
![](../assets/git-cycle/git-cycle-02.jpg)
270+
:::
271+
272+
## The `git` cycle: `add` {.smaller}
273+
274+
It tells git, *'pay attention to any changes I make to this file'*
275+
276+
::: {#fig-cycle-03}
277+
![](../assets/git-cycle/git-cycle-03.jpg)
278+
:::
279+
280+
## The `git` cycle {.smaller}
281+
282+
When a file on the stage is modified, git notices and flags it with 'M'
283+
284+
::: {#fig-cycle-04}
285+
![](../assets/git-cycle/git-cycle-04.jpg)
270286
:::
271-
::::
272287

273288
## The `git` cycle {.smaller}
274289

275-
How does this have anything to do with `git`?
290+
When an unstaged file is added or modified, git notices and flags it with 'U'
291+
292+
::: {#fig-cycle-05}
293+
![](../assets/git-cycle/git-cycle-05.jpg)
294+
:::
295+
296+
## The `git` cycle: `commit` {.smaller}
297+
298+
`git commit` creates a record of the changes in the version history
299+
300+
::: {#fig-cycle-06}
301+
![](../assets/git-cycle/git-cycle-06.jpg)
302+
:::
303+
304+
## The `git` cycle: `commit` {.smaller}
305+
306+
+ Each commit can be identified by its unique ID or hash
307+
+ A message must be included with each commit, explaining the change
308+
309+
::: {#fig-cycle-07}
310+
![](../assets/git-cycle/git-cycle-07.jpg)
311+
:::
312+
313+
## The `git` cycle: picnic analogy {.smaller}
314+
315+
Maeve likes to think of it like packing a picnic basket:
276316

277317
:::: {.box-ly}
318+
319+
::: {.incremental}
278320
1. I make a sandwich and wrap it up
279-
2. I add it to the basket
321+
2. I **add** it to the basket
280322
3. I chop up some fruit and put it in a lunchbox
281-
4. I add *that* to the basket
323+
4. I **add** that to the basket
282324
5. I make a smoothie and bottle it
283-
6. I add *that* to the basket too
284-
7. Finally, I close over the top of the picnic basket and secure the latch
325+
6. I **add** that to the basket too
326+
7. Finally, I close the picnic basket and secure the latch
327+
:::
285328
::::
286329

287-
## The `git` cycle {.smaller}
330+
## The `git` cycle: picnic analogy {.smaller}
288331

289-
Let's introduce the concept of `add` as well as `commit`.
332+
How is it like the git cycle?
290333

291334
:::: {.box-ly}
292335
1. I make a sandwich and wrap it up -> **I make some edits to files/create new files in my project folder**
@@ -300,20 +343,6 @@ Let's introduce the concept of `add` as well as `commit`.
300343

301344
## The `git` cycle
302345

303-
Let's introduce the concept of `add` as well as `commit`.
304-
305-
:::{.incremental}
306-
- You create or edit files, *then*
307-
- You `add` those changes, *then*
308-
- You either create/edit more files and repeat `add` *or* you `commit` all the added changes with a little message
309-
:::
310-
311-
:::: {.box-lp}
312-
I think of `git add` as like a quick save, whereas `git commit` is a full, proper save.
313-
::::
314-
315-
## The `git` cycle
316-
317346
[create/edit -> add -> commit]{.extra}
318347

319348
:::::: {.columns}
@@ -398,4 +427,16 @@ As well as being able to "undo" entire commits, you can undo different stages of
398427

399428
::::::
400429

430+
## Maeve's mammoth commit {.smaller}
431+
432+
::: {.incremental}
433+
+ Maeve's picnic commit was pretty big!
434+
+ What if she wants to remove the fruit without removing the sandwich and smoothie?
435+
+ In practice, aim to keep commits small and focused on a specific update or bugfix
436+
:::
437+
438+
::: {#fig-cycle-08}
439+
![](../assets/git-cycle/git-cycle-08.jpg)
440+
:::
441+
401442
# Let's try it out...

0 commit comments

Comments
 (0)