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

2 1

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.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay