@@ -373,11 +373,33 @@ \subsection{Fixup commits}
373
373
\subslidetitle
374
374
\ begin{lstlisting}
375
375
$ (*\textcolor[HTML]{0000AA}{git log --oneline}*)
376
- (*\textcolor[HTML]{ae6617}{633a534}*) change the green moon to red
377
- (*\textcolor[HTML]{ae6617}{368a328}*) remove the blue moon
376
+ (*\textcolor[HTML]{ae6617}{633a534}*) add green moon
377
+ (*\textcolor[HTML]{ae6617}{368a328}*) change the moon to blue
378
378
\end {lstlisting }
379
379
380
- Let's fix something in the 'remove the blue moon' commit.
380
+ Let's add a comment to the 'change the moon to blue' commit.
381
+
382
+ \ begin{lstlisting}
383
+ $ (*\textcolor[HTML]{0000AA}{git diff}*)
384
+ diff --git a/moon.js b/moon.js
385
+ index 24e6080..03ef6a2 100644
386
+ --- a/moon.js
387
+ +++ b/moon.js
388
+ (*\textcolor[HTML]{0000EE}{@@ -16,7 +16,7 @@}*) let ctx = {
389
+ };
390
+ // create moons
391
+ (*\textcolor[HTML]{00AA00}{+}*)(*\textcolor[HTML]{00AA00}{// the moon is blue}*)
392
+ new Moon("blue");
393
+ new Moon("green");
394
+
395
+ \end {lstlisting }
396
+
397
+ \end {frame }
398
+
399
+ \subsection {Fixup commits }
400
+ \begin {frame }[fragile]
401
+ \subslidetitle
402
+
381
403
And commit that as fixup:
382
404
\ begin{lstlisting}
383
405
git commit -a --fixup=368a328
@@ -386,9 +408,9 @@ \subsection{Fixup commits}
386
408
Now our git log should look like this:
387
409
\ begin{lstlisting}
388
410
$ (*\textcolor[HTML]{0000AA}{git log --oneline}*)
389
- (*\textcolor[HTML]{ae6617}{ca78a62}*) fixup! remove the blue moon
390
- (*\textcolor[HTML]{ae6617}{633a534}*) change the green moon to red
391
- (*\textcolor[HTML]{ae6617}{368a328}*) remove the blue moon
411
+ (*\textcolor[HTML]{ae6617}{ca78a62}*) fixup! change the moon to blue
412
+ (*\textcolor[HTML]{ae6617}{633a534}*) add green moon
413
+ (*\textcolor[HTML]{ae6617}{368a328}*) change the moon to blue
392
414
\end {lstlisting }
393
415
394
416
Which allows us to automatically put them in the right place in a interactive rebase.
0 commit comments