Sign inSign up free

777. Commits Made on a Detached HEAD

easy 10 XP ~6 minHands-on lab

In /home/student/repos/docs-site you checked out the tag v1.2 to reproduce a customer bug, found the fix and made two commits. git status now says "HEAD detached from v1.2". You realise no branch holds those commits.

Task

  • Create the branch hotfix/1.2.1 containing your two commits (on top of v1.2) and switch to it.
  • Don't change main or the tag v1.2.

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Part of Git Essentials. Next step: Set Up Remotes for a Fork Workflow

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.