Skip to content

Commit e460da1

Browse files
committed
simplify exercise, removing git add -p
i think git add -p is mostly useful to stage different parts of a changed file (hunks), but hunks must be separated by unchanged lines in a file and so is not very useful for a small file like our recipe
1 parent e01d6c8 commit e460da1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

_episodes/06-staging-area.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,14 @@ $ git commit # commit everything that is staged
139139
- The `-p` option gives you even more control, and as a bonus shows you the diffs as you stage/reset/checkout things.
140140

141141

142-
## Exercises
142+
## Exercise: Using the staging area
143143

144144
1. In your recipe example, make two different changes to
145145
`ingredients.txt` and `instructions.txt` which do not go together.
146-
2. Use `git add` to stage them and put them into two different commits.
147-
3. Make two more unrelated changes now in the same file, but stage them separately using
148-
`git add -p`. Use `?` to figure out what the
149-
different commands are, and try at least `y`, `n`, `d`, `a`, `q`.
150-
4. Make two changes. Stage one and checkout the other.
151-
5. Make a change and stage it. Feel some regret, and unstage it.
146+
2. Use `git add` to stage one of the changes.
147+
3. Use `git status` to see what's going on, and use `git diff` and `git diff --staged` to see the changes.
148+
4. Feel some regret and checkout the unstaged change.
149+
5. Feel further regret and unstage the staged change.
152150

153151
---
154152

0 commit comments

Comments
 (0)