Menu
CoddyTech

Recap - Time Machine

Part of the Version Control section of Coddy's Terminal journey. Lesson 45 of 58.

challenge icon

Challenge

Medium

The folder contains page.html. Walk through this:

  1. Initialize the repo, configure user, and commit page.html with message Add page.
  2. Append the line oops to page.html and commit with message Add oops.
  3. Revert the latest commit (no editor) so the bad line is undone in a new commit. git revert has no -q flag, so add > /dev/null to hide its summary.
  4. Print the total number of commits and the contents of page.html, in that order.

Use git rev-list --count HEAD for the count, then cat page.html. These two commands must be the only ones that print anything, so keep every other command quiet (-q or > /dev/null).

Try it yourself

Terminal

All lessons in Version Control

Practice on your own: Terminal playground