Getting Started with Git

7 / 16

GitHub Project - Getting Started with Git - Creating a Branch

We can create a new branch using the command git branch <branch_name>.

For example, to create a testing branch, type below command in the terminal

git branch testing

To checkout to testing branching, type below command

git checkout testing

With -b switch we can combine the above two steps into one. For example, to create the dev branch and checkout to it at the same time, user below command

git checkout -b dev
INSTRUCTIONS
  • Make sure you are in ~/devops directory
  • Check the branch you are in using git branch command
  • If you are not in master then checkout to master branch using git checkout master command
  • Now create a new branch feature_a and checkout to that branch
Get Hint See Answer


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...