Create Branch By Command Github

Photo by Jess Bailey on Unsplash

Create Branch By Command Github

Command - Create a branch

  • $git checkout -b "Name"

  • $git add .

  • $git commit -m"Messag3"

  • $git push origin BranchName

Explaining Above commands

Checkout -b will create a branch then add all the files and commit a message then you can push it to a branch

Check the Branch you are currently on

$git branch

As per our previous Blog, I've assisted you in pushing your work to a GitHub repository, specifically on a branch named 'branch2' while currently staying on 'branch1'


Thank you