Video: Commit the selected hunk, not the whole file
The video plays in YouTube’s player, in privacy-enhanced mode.
- 4 min video
- English narration · English and Arabic captions
- Watch on YouTube
Prepare a headline and a wider hero while leaving a separate card-radius edit for later. Use file, hunk and line selection deliberately, then prove the exact prepared and remaining CSS.
Read the full lesson
The article has every step and command from the video, the practice exercise and the questions.
Video transcript
The narration of the video, cue by cue.
- Prepare one change while preserving the next one.
- Nearby edits can belong to different intentions.
- Save the headline and both CSS edits before selecting the commit.
- Read both changes before choosing either.
- Start with the isolated headline replacement.
- Stage this headline hunk, not an unrelated file change.
- Keep the full diff visible for line selection.
- A replacement includes the removed and added lines.
- Stage the width pair while leaving radius outside.
- Check prepared content and remaining content separately.
- Unstaging repairs selection without discarding working text.
- Whole-hunk selection is equivalent only for this exact hunk.
- Clearing checkboxes does not unstage or delete content.
- The native patch updates the index, not the working file.
- Verify the complete selected file, not just a highlight.
- Which radius belongs to the prepared snapshot?
- Commit the headline and width, leaving radius for later.
- The remaining CSS edit is the intended result.
- The next lesson will record the independent radius edit.
- If you select radius too, nothing remains in the CSS diff.
- A changed diff requires a fresh selection, not force application.
- Do not discard useful work to fix a staged selection.
- Name the prepared and remaining edits before continuing.
- Keep the radius edit for the next explicit commit.