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
More on Commits, branches and tags
How do you write a good commit message?BeginnerWhat is the difference between `git add .`, `git add -A` and `git add -u`?BeginnerHow do you commit only part of the changes in a file?BeginnerHow do you change the last commit message or add a forgotten file?BeginnerWhat is the difference between `git switch`, `git restore` and `git checkout`?BeginnerWhat is the difference between lightweight and annotated tags?Beginner