Skip to content
10 · Field Guide

Git, GitHub, and the terminal

Version control and the command line, framed as safe habits rather than intimidating tools.

The mental model

Git records the history of a project on your computer. A repository is the project Git tracks. A commit is a named checkpoint. A branch is a parallel line of work. A merge combines changes.

GitHub stores repositories online and supports review and collaboration. You push local commits to the remote repository and pull remote changes to your machine. A pull request proposes merging one branch into another and creates a place for review.

The everyday Git loop

bash
$ git switch main
$ git pull
$ git switch -c feature/recharge-flow

# work and review
$ git status
$ git add .
$ git commit -m "Build recharge question flow"
$ git push -u origin feature/recharge-flow

Then open a pull request, review, merge, return to main, and pull again.

For a solo learning project, you can work more simply. The principles still matter: check status, commit meaningful checkpoints, and push a backup before risky changes.

Terminal essentials

CommandMeaning
pwdShow the folder you are currently in
lsList files and folders
cd folder-nameEnter a folder
cd ..Move up one folder
mkdir project-nameCreate a folder
code .Open the current folder in VS Code, if configured
npm installInstall the project’s listed packages
npm run devStart the local development server
npm run buildCreate or verify a production build, if defined
git statusShow changed files and current branch
git diffShow unstaged line-by-line changes
Ctrl + CStop a running terminal process

Safe habits

  • Run pwd and ls when you are unsure where you are.
  • Read destructive commands carefully. rm does not normally use a recycle bin.
  • Do not use sudo because an error message told you to; understand why it is needed.
  • Ask the agent to explain a command before you approve it.
  • Use git status before and after agent changes.
  • Commit before large experiments so you have a clear recovery point.
  • Do not commit secrets, generated dependency folders, or local environment files.