Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 850 Bytes

01-Git-Branches.md

File metadata and controls

43 lines (30 loc) · 850 Bytes

Git Branches

In this section, we will take a look at git branches

Branches

  • Keep project versioned using branch

  • A branch is basically a pointer to the last commit

    gitb1

  • If you are working on a feature, you might work on a feature branch (eg. feature/signup), once the features are tested, you can merge to master branch

    gitb2

  • To create a new branch

    $ git branch sarah
    
  • To create a new branch and switch to it

    $ git checkout -b sarah
    
  • To list of all of our branches

    $ git branch
    

    gitb3

  • Switch to exisiting branch

    $ git checkout sarah
    
  • Delete a branch

    $ git branch -d max