Sunday, September 22, 2019

Git: Create new branch in local

For example we are in branch B and now we have to commit some code to new branch C
Instead of going to gitserver like bitbucket or gitlab to create new remote branch C and then check out from local and then switch to new branch to work.

We can use the command below to create new branch C while you are in branch B.
git checkout -b [branchC]
Then you can do your job and commit like usual.

No comments:

Post a Comment