← All articles

A calmer Git workflow for everyday work

Small commits, deliberate staging, and a short review loop make changes easier to understand and ship.

Starter article · An example publication for your new blog. Replace or edit it before launch.

A repository tells the story of a project through changes. A clear Git workflow helps the next person understand what happened, including when that person is you a month later.

Look before staging

Start by checking the working tree and reading the diff. This catches temporary logging, unrelated edits, and generated files before they enter a commit.

git status --short
git diff

Stage specific files when you are working on several things. Use interactive staging to select individual changes within a file.

git add -p
git diff --cached

Read the staged diff as if you were reviewing someone else’s work. Confirm that the commit includes the supporting changes needed for the feature to work.

Give each commit a clear purpose

A helpful commit message describes the change in terms a future reader can recognize.

git commit -m "Add language switching to article pages"

Keep the implementation and its required configuration together. If a change modifies a content format, update the affected content in the same coherent change so the project continues to build.

Verify through the normal entry point

Run the checks that match the project. For this blog, verify TypeScript and produce a static build.

npm run typecheck
npm run build

Serve the generated output and open a real article page. Follow links, switch languages, and try a narrow mobile viewport. A successful build and a usable page provide different kinds of feedback.

Push and inspect the result

Before pushing, confirm the destination branch. Then inspect the remote build or deployment when your workflow includes one.

git branch --show-current
git push

A small review loop keeps the cost of a correction low. Inspect, stage, verify, and publish with a clear view of what the change contains.