When a user ends up in a "detached head" state, this is a scary situation, but as we know, Git is not scary.
- Run
source setup.sh(or.\setup.ps1in PowerShell)
- Run
git statusandgit log --oneline --graph --allto see what is going on. - Restore normalcy in this repository by moving to
master
Note that this task might seem more confusing if you did not run setup.sh in your terminal.
We want to have a branch called the-beginning that is made from the first commit with message A.
- Can you do this by first causing a detached head?
git statusgit log --oneline --graph --allgit checkout <ref>orgit switch --detach <ref>