Skip to content

Commit f889fb7

Browse files
committed
Adding more of the exercises for the commits section
1 parent d05963f commit f889fb7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/commits-exercises.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,28 @@ Enter the `repository/` directory under `git_materials/4.commits/2.recover_head`
5555
- rev-parse
5656
- cat .git/something
5757

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)
82+

0 commit comments

Comments
 (0)