DEV Community

Cover image for How to use git branches for the organized code base you always wanted
Code Mochi
Code Mochi

Posted on • Edited on

How to use git branches for the organized code base you always wanted

In this video blog I’ll go over why we use git to manage our projects and why committing all your code to a master branch is absolute insanity and something you should never do. Instead, you should create feature branches- they allow you to create discrete chunks of code that you add to your staging branch one feature at a time until you have a version that you are ready to deploy to master.

You’ll see how this allows us to always have a production branch that is ready to go, a staging branch that has all the latest features but isn’t quite ready for prime time, and a feature branch that we can develop and break as much as we want without impacting anyone else.

Git Branches for Well Ordered Code- #1 Overview

Git Branches for Well Ordered Code- #2 Code Demo

Download the Git Cheatsheet

We made a step-by-step guide that explains how to use Github and GitKraken to setup your repository and use pull requests with and without a squash to merge your code. Check it out at Code Mochi.

There is more where that came from!
Click here to give us your email and we'll let you know when we publish new stuff. We respect your email privacy, we will never spam you and you can unsubscribe anytime.

Top comments (0)