Branch development with git

Published: (December 2, 2025 at 05:39 AM EST)
3 min read
Source: Dev.to

Source: Dev.to

Overview

Cover image for Branch development with git

Branch development is a key aspect of software development. The idea here is you clone (i.e. copy) the code you’re going to work on onto your own computer, then you can make your necessary changes, then lastly save it back to the official code repository. In other words, you take the copied code and “branch” off with it to make changes. Then you “merge” your branch back into the main repository of code.

In my old job, Pega handled this on its own. It had its own branching tools, so I could copy the low‑code settings into my own branch, make my changes, then check them back in to the official code. But outside of low‑code tools like Pega, developers primarily use git to help manage their branch development.

With 100Devs, I’ve been pushing the HTML and CSS projects into GitHub. In the past, I would not create branches. I would just clone the code down, make changes, then merge the code straight into the main branch without creating my own branches or opening a pull request. While that works for small one‑developer projects, it won’t work long‑term in my learning.

Below is the workflow I’ve been using for the past few weeks. I’m writing this mainly for myself — I forget the terminal commands sometimes and need a reminder. Hopefully this can also help you, the reader, if you are just starting out and learning git.

Common Git commands

  • git checkout -b <branch-name> – Creates a new branch with the given name and checks it out immediately.
  • git branch – Lists all local branches; the current branch is marked (e.g., with *).
  • git status – Shows files that have been changed but are not yet staged.
  • git add <file> – Stages a specific file for the next commit.
  • git add . – Stages all changed files (use with caution).
  • git commit -m "" – Records the staged changes in a new commit. This does not push to GitHub yet. I follow the guidelines of Conventional Commits.
  • git push origin <branch-name> – Pushes the local branch to GitHub. If the branch does not exist remotely, it will be created. GitHub will then offer the option to open a pull request (or a draft pull request).

That’s it! I wanted to document the common commands I use in git. I’ll be posting again soon with more learnings from 100Devs, but I wanted to get this post out first as I know it will come in handy later on for more projects I’m building.

What other git commands do you think I should know and put into practice?

Back to Blog

Related posts

Read more »

core.async: Deep Dive — Online Meetup

Event Overview On December 10 at 18:00 GMT+1, Health Samurai is hosting an online meetup “core.async: Deep Dive.” The talk goes under the hood of clojure.core....