Good Code
The good version checks the current branch, working tree, remote state, and visible diff before making a decision.
Lesson 01
Start every change by checking branch, cleanliness, and upstream state so you do not build on the wrong base.
# Confirm branch and local changes before editing.
git status --short --branch
git fetch origin
git status --short --branch
git diff --stat# Pulling first can hide which base changed under you.
git pull
code src/app.ts
git add .
git commit -m "updates"The good version checks the current branch, working tree, remote state, and visible diff before making a decision.
The bad version pulls first, starts editing, and commits everything without proving which branch it is on or what changed.