You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/commits-exercises.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,3 +55,28 @@ Enter the `repository/` directory under `git_materials/4.commits/2.recover_head`
55
55
- rev-parse
56
56
- cat .git/something
57
57
58
+
## 3. Stashing uncommitted changes
59
+
60
+
!!! note
61
+
62
+
The goal of this exercise is to learn to checkout a different commit and stash uncommited changes, if necessary.
63
+
64
+
Enter the `repository/` directory under `git_materials/4.commits/3.stash` and perform the following steps:
65
+
66
+
1. Identify the first commit (`This is going to be a cake recipe`).
67
+
2. Try to checkout the commit in order to identify the initial title of the recipe. If necessary, stash the changes. What was the initial title of the recipe?
68
+
3. Restore the `HEAD` and pop the changes from the stash.
69
+
4. Confirm that the changes were applied correctly and that the stash is empty.
70
+
71
+
## 4. Discarding the latest commit
72
+
73
+
!!! note
74
+
75
+
The goal of this exercise is to learn to discard the latest commit.
76
+
77
+
Enter the `repository/` directory under `git_materials/4.commits/4.discard` and perform the following steps:
78
+
79
+
1. Discard the latest commit. Also discard the changes in the working tree.
80
+
2. Confirm that the commit is no longer reachable from `master`. Confirm that the `recipe.txt` no longer contains the section "Other ideas and hints".
81
+
3. Try to restore the discarded commit. (optional)
0 commit comments