Skip to content

Commit

Permalink
Add fix your mistakes demo videos
Browse files Browse the repository at this point in the history
Add demo videos for fix your mistakes section.

These videos demonstrate how to fix common mistakes using amend,
restore and multiple commits.
  • Loading branch information
mikelorant committed Jan 3, 2024
1 parent a25fcbf commit 0c5c9fe
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pages/fix-your-mistakes.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ git commit --amend --no-edit

</div>

---
layout: full
preload: false
---

<video autoplay controls loop>
<source src="/videos/fix-your-mistakes-amend.webm" type="video/webm">
</video>

---
layout: image-right
image: https://images.unsplash.com/photo-1591014827159-2e158ceac55d
Expand All @@ -48,6 +57,15 @@ git add -p
git commit --amend --no-edit
```

---
layout: full
preload: false
---

<video autoplay controls loop>
<source src="/videos/fix-your-mistakes-restore.webm" type="video/webm">
</video>

---
layout: image-right
image: https://images.unsplash.com/photo-1577594829182-ff8eb109760e
Expand All @@ -72,3 +90,12 @@ git commit
<ph-warning-bold /> Use this method when the branch is shared with other users and the previous commit has already been pushed.

</div>

---
layout: full
preload: false
---

<video autoplay controls loop>
<source src="/videos/fix-your-mistakes-commit.webm" type="video/webm">
</video>
3 changes: 3 additions & 0 deletions public/videos/fix-your-mistakes-amend.webm
Git LFS file not shown
3 changes: 3 additions & 0 deletions public/videos/fix-your-mistakes-commit.webm
Git LFS file not shown
3 changes: 3 additions & 0 deletions public/videos/fix-your-mistakes-restore.webm
Git LFS file not shown
25 changes: 25 additions & 0 deletions scripts/video/tapes/fix-your-mistakes-amend.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Output ../../public/videos/fix-your-mistakes-amend.webm

Set Width 1050
Set Height 700

Source tapes/sources/init.tape
Source tapes/sources/git-commit-feature1.tape

Ctrl+L

Show Sleep 1

Type "git show -p" Sleep 1 Enter Sleep 3

Ctrl +L Sleep 0.25

Source tapes/source/git-commit-feature1-improve.tape

Type "git commit --amend --no-edit" Sleep 1 Enter Sleep 3

Ctrl+L Sleep 0.25

Type "git show -p" Sleep 1 Enter Sleep 3

Source tapes/sources/terminate.tape
31 changes: 31 additions & 0 deletions scripts/video/tapes/fix-your-mistakes-commit.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Output ../../public/videos/fix-your-mistakes-commit.webm

Set Width 1050
Set Height 700

Source tapes/sources/init.tape
Source tapes/sources/git-commit-feature1.tape

Ctrl+L

Show Sleep 1

Type "git show -p" Sleep 1 Enter Sleep 3

Ctrl +L Sleep 0.25

Source tapes/sources/git-commit-feature1-improve.tape

Type "git commit" Sleep 1 Enter
Type "i" Sleep 0.25
Type "Improve feature1" Sleep 1
Escape
Type "ZZ" Sleep 3

Ctrl+L Sleep 0.25

Type "git show -p main.." Sleep 1 Enter Sleep 3
Type " " Sleep 3
Type "q" Sleep 1

Source tapes/sources/terminate.tape
55 changes: 55 additions & 0 deletions scripts/video/tapes/fix-your-mistakes-restore.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Output ../../public/videos/fix-your-mistakes-restore.webm

Set Width 1050
Set Height 700

Source tapes/sources/init.tape

Source tapes/sources/git-commit-feature1.tape
Source tapes/sources/git-commit-feature1-improve.tape
Source tapes/sources/git-commit-feature1-unrelated.tape

Type "git commit" Sleep 0.25 Enter
Type "i" Sleep 0.25
Type "Fix" Sleep 0.25
Escape
Type "ZZ" Sleep 0.25

Type "git rebase -i main" Enter Sleep 0.25
Down
Type "cw" Sleep 0.25
Type "f" Sleep 0.25
Escape
Type "ZZ"

Ctrl+L

Show Sleep 1

Type "git show -p" Sleep 1 Enter Sleep 3
Type " " Sleep 1
Type "q" Enter Sleep 1

Ctrl+L Sleep 0.25

Type "git restore --source=main --patch" Sleep 1 Enter Sleep 3
Type "s" Sleep 1 Enter Sleep 3
Type "y" Sleep 1 Enter Sleep 3
Type "n" Sleep 1 Enter Sleep 3

Ctrl+L Sleep 0.25

Type "git diff" Sleep 1 Enter Sleep 3

Ctrl+L Sleep 0.25

Type "git add -p" Enter Sleep 3
Type "y" Sleep 1 Enter Sleep 1

Type "git commit --amend --no-edit" Sleep 1 Enter Sleep 3

Ctrl+L Sleep 0.25

Type "git show -p" Sleep 1 Enter Sleep 3

Source tapes/sources/terminate.tape
8 changes: 8 additions & 0 deletions scripts/video/tapes/sources/git-commit-feature1-improve.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Type "vim .data" Enter Sleep 1
Type "8Gi" Sleep 0.25
Type "IMPROVED " Sleep 1
Escape
Type "ZZ" Sleep 1

Type "git add -p" Enter Sleep 3
Type "y" Sleep 1 Enter Sleep 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Type "vim .data" Enter Sleep 1
Type "2Gi" Sleep 0.25
Type "UNRELATED " Sleep 1
Escape
Type "ZZ" Sleep 1

Type "git add -p" Enter Sleep 3
Type "y" Sleep 1 Enter Sleep 1

0 comments on commit 0c5c9fe

Please sign in to comment.