Recently I tried to explain to a colleague my mental model for when to put something in the same pull request and when not to. I caught myself saying

How I use git - by Thorsten Ball - Register Spill

submited by
Style Pass
2024-10-16 15:30:15

Recently I tried to explain to a colleague my mental model for when to put something in the same pull request and when not to. I caught myself saying “well, except…” a few times, I decided to write down how I use git — to examine my idiosyncracies, see where I could improve, and possibly share something useful.

Since this is the Internet, let me add the disclaimer right here at the top: how I use git is based on the last 12 years of working in companies with smallish (less than 50) engineering teams. In every team, we used git and GitHub exclusively; changes were made in branches, proposed as pull requests, and then merged into the main branch. In the last few years, after GitHub introduced squash-merging, we used that.

Everything is in git, all the time. Every side-project, large or small, finished or abandoned, is in a git repository. Running git init is the first thing I do in a new folder. I do not know why I wouldn’t use git if I could.

The git part is the most important piece in my shell prompt. I feel naked when I don’t have it. It shows the current branch and whether the repository is dirty, i.e. whether it has uncommitted changes:

Leave a Comment