git happy

Everything you ever wanted to know about the Git command line and the GitHub Desktop GUI. git happy!

Follow publication

Member-only story

Navigating Git Branches Like a Pro: The Git Branch Command

Dr. Derek Austin 🥳
git happy
Published in
6 min readNov 19, 2023

I thought Git branches were for sleeping and looking cute? Photo by Chalo Garcia on Unsplash

As a professional software developer, you might have noticed a few similarities between your codebase and a community of mapaches 🦝. They’re both intricately organized, require patience to understand, and have a lot of hidden treasures waiting to be discovered.

In this article, I’m going to take you through the woodland pathways of Git branches, using both the command line and GitHub Desktop. And yes, our guide through this adventure will be a code mapache, because (hissing)!

The Basics of Branching in Git

Branching is an integral part of Git version control. It allows developers to work on different features simultaneously without disrupting the main line of development, which is usually the main branch (or sometimes develop).

# Let's create a new mapache branch!
git branch "new_mapache_branch"

# Let's switch to (or "check out") our new branch.
git checkout "new_mapache_branch"

After doing the work on this new branch, it can be merged back into the main (or develop) branch, either…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

git happy
git happy

Published in git happy

Everything you ever wanted to know about the Git command line and the GitHub Desktop GUI. git happy!

Dr. Derek Austin 🥳
Dr. Derek Austin 🥳

Written by Dr. Derek Austin 🥳

Hi, I'm Doctor Derek! I've been a professional web developer since 2005, and I love writing about programming with JavaScript, TypeScript, React, Next.js & Git.

Write a response

Thank you for this overview. I really would like to see a brief comparison of git checkout and git switch in the article.

I can also recommend to install git command line completion, available for ash, bash, … It allows you to use <Tab> to complete commands, options, branch names and relevant file names.

To me doing it like a pro in 2023 with the current versions would mean using git switch instead of the arcane git branch commands - it makes things infinitely more consistent including setting up the remote branch etc