Count names through branch maintenance

A developer is cleaning up branches after a release. Initially, there are exactly three local branches: main, draft and archive. All three point to the same commit, and draft is selected. None has a configured upstream.


Treat each table row as an independent experiment starting from this initial state. There is only one working tree, it has no uncommitted changes, and no other commands run. If a command is refused, record the unchanged state.


Complete the table with exact integer counts and the selected branch name. Count only local branches; count commits newly created by the command, not commits already present.

Command attemptedLocal branches afterwardSelected branch afterwardCommits created
git branch review main
git branch -m draft report
git branch -d draft
git branch -d archive
git switch main

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 Branches Questions: