How do I create a new branch in Git?
The git branch command may be used to create a new branch. after you need to start a new feature, you create a new branch off main using git branch new_branch . Once created you'll then use git checkout new_branch to switch to that branch.
Example
git branch hello-world-images
Now we created a new branch referred to as "hello-world-images"
Let's make sure that we've got created a new branch:
Example
git branch
hello-world-images
* master
We can see the new branch with the name "hello-world-images", however the * beside master specifies that we are presently on that branch.