How do you create a new branch from an existing branch in Git?
a)
git checkout -b new-branchb)
git branch create new-branchc)
git switch --create new-branchd)
git merge --create new-branchAnswer:
a)
git checkout -b new-branchExplanation:
The git checkout -b new-branch command creates a new branch and immediately switches to it. This is a commonly used command when you want to start work on a new feature or task.
This command is equivalent to running git branch new-branch followed by git checkout new-branch in a single step.
Creating new branches is essential for isolating work on features, bug fixes, or experiments.