DEV Community

Donalda Feith
Donalda Feith

Posted on

The 7-Minute Git Workflow That Keeps Me Sane (and My Repo From Looking Like a Crime Scene)

Git is powerful. It’s also a black hole where hours disappear if you’re still typing the same long commands you learned in 2014 or digging through a history full of “fix typo” commits from three months ago. I’ve whittled my daily routine down to something I can do without cursing into my soda. It’s fast, clean, and takes under seven minutes per task.

  1. Make a new branch every time

git checkout -b feature/short-descriptive-name

No “one branch to rule them all.” Bug fixes, new features, experiments—each gets its own.

  1. Stage only what you mean to commit

git add -p

Keeps you from cramming unrelated changes into one commit, which is basically code hoarding.

  1. Keep commit messages short and clear Format:

[type] present-tense description

Example:

fix: correct typo in config loader

  1. Rebase for cleanup, don’t merge

git pull --rebase origin main

Keeps history straight so you don’t need a red string conspiracy board to follow it later.

  1. Squash before you send it off

git rebase -i HEAD~n

Replace n with however many commits you’re mashing together.

  1. Push it up

git push -u origin feature/short-descriptive-name

This saves me from the “what fresh hell is this” moment when reviewing old code. History stays readable. Brain stays uncluttered. And if you’ve been treating your repo like a junk drawer, try this for a week. You won’t go back.

Top comments (0)