Interview Prep/Git & GitHub/Commits, branches and tags

How do you create a branch from a past commit or tag, and from a remote branch?

IntermediateConceptCommits, branches and tags
Answer

Pass a start point. For a remote branch, git switch <name> auto-creates a tracking branch if exactly one remote has it.

git switch -c hotfix/1.3.1 v1.3.0
git switch -c review/pr-482 origin/feature/x
git switch feature/x    # DWIM tracking
All Git & GitHub questions Roadmap: Git & GitHub

More on Commits, branches and tags