What is the command to create a new branch in Git?
a)
git branch new-branchb)
git new-branchc)
git checkout branchd)
git switch branchAnswer:
a)
git branch new-branchExplanation:
The git branch new-branch command creates a new branch named “new-branch” in the current repository. This branch is based on the current commit and allows you to work on changes independently from other branches.
Once the new branch is created, you can switch to it using git checkout new-branch or git switch new-branch to start working on it. This separation allows multiple developers to work on different features without affecting each other’s work.
Branches are fundamental to collaborative workflows, enabling teams to develop features in parallel and later merge them into the main project.