Commits in the log after amend and revert

In a repository whose working tree is clean, git log --oneline lists 14 commits. You then do the following, in order:

  1. Edit app.js, stage it with git add, and run git commit.
  2. Immediately run git commit again with a new message, without editing or staging anything.
  3. Run git commit --amend to correct the message of the most recent commit.
  4. Edit style.css and index.html, stage both, and record them with a single git commit.
  5. Run git revert HEAD, accept the default message, and let it finish with no conflicts.

How many commits does git log --oneline list after step 5? Give your answer as a whole number.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Git Questions: