Git : A basic understanding for every Dev - Part II

Git : A basic understanding for every Dev - Part II

ยท

1 min read

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

Branches

  • Keep the project versioned using the branch

  • A branch is basically a pointer to the last commit

  • 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

  • To create a new branch

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

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

      $ git branch
    
  • Switch to exisiting branch

      $ git checkout sarah
    
  • Delete a branch

      $ git branch -d max
    

    Git Merging Branches

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

    We can merge a branch with 'git merge' command

      $ git checkout master
      $ git merge feature/signup
    

    Two types of merge that git can perform

    1. Fast forward merge

    2. No-Fast Forward merge

Want to learn and explore more about git? Then do checkout the Git : A basic understanding for every Dev - Part III

Hop into the blog section for a more interesting and detailed overview of Software development and other stuff. ๐Ÿ˜Š

ย