Developer workflow cheat sheet
The Developer track on a few screens: the terminal commands you will type most, the Git command for what you want to do, the VS Code shortcuts worth your fingers, the JavaScript traps that catch everyone, the words engineers use, and what to read next. Each row links to the lesson that explains it. Keep it open in a tab while you work.
Terminal: "I want to..."
bash and zsh (macOS, Linux and Git Bash on Windows) take the same commands; PowerShell differs. On Windows, Git Bash keeps your commands the same as your teammates' and CI's (The terminal without fear).
| I want to... | bash / zsh / Git Bash | PowerShell | Lesson |
|---|---|---|---|
| See which folder I am in | pwd | Get-Location | Terminal |
| List files, including hidden ones | ls -la | Get-ChildItem -Force | Terminal |
| Make nested folders | mkdir -p a/b/c | New-Item -ItemType Directory -Force a/b/c | Terminal |
| Delete a folder, after checking the path | pwd, ls folder, then rm -r folder | Remove-Item -Recurse folder -WhatIf first | Terminal |
| Keep the lines that match | grep '^S-014' sales.csv | Select-String '^S-014' sales.csv | Terminal |
| Count lines per value in column 1 of a CSV | tail -n +2 f.csv | cut -d, -f1 | sort | uniq -c | Import-Csv f.csv | Group-Object siteId | Terminal |
| Send output to a file (replace, append) | > file, >> file | > file, >> file | Terminal |
| See the last exit code | echo $? | $LASTEXITCODE | Terminal |
| Set a variable for this terminal | export STORE_ID=S-014 | $env:STORE_ID = 'S-014' | Terminal |
| Set a variable for one command only | STORE_ID=S-102 node report.js | Set it, run, then set it back | Terminal |
| See which copy of a program runs | which -a node | Get-Command node -All | Terminal |
| Let a script run as a program | chmod +x script.sh | Not needed | Terminal |
npm in one breath
npm init -y starts a package.json. npm install downloads what it lists into node_modules; npm ci installs exactly what the lockfile says, for CI. npm install --save-dev --save-exact prettier adds a pinned tool to the project. npm start, npm test and npm run lint run scripts by name, and npm pkg set scripts.lint="eslint ." adds one. npx prettier --check . runs the project's own copy of a tool. npm ls --depth=0 shows what is installed (How code becomes a running program, The terminal without fear, Node.js and npm).
Git: "I want to..."
Every command here was run on Git 2.43. Commands that change history are marked; use them only on commits you have not pushed, or that only you use.
| I want to... | Command | Lesson |
|---|---|---|
| Start tracking a project | git init -b main | Snapshots |
| Set my name and email once | git config --global user.name "Your Name" and user.email | Snapshots |
| See what changed and what is staged | git status, git diff, git diff --staged | Everyday Git |
| Stage only part of a file | git add -p file | Everyday Git |
| Commit with a good message | git commit -m "fix(pos): round VAT in cents" | Everyday Git |
| Read history as a graph | git log --oneline --graph --all | Everyday Git |
| Find when a piece of text appeared or disappeared | git log -S "discountCents" --oneline | Code detective |
| See who last changed a line | git blame -L 40,60 src/stock.ts | Code detective |
| Start a branch and switch to it | git switch -c feat/123-short-name (older: git checkout -b) | Branches |
| Merge a branch, always with a merge commit | git merge --no-ff feat/123-short-name | Branches |
| Delete a merged branch | git branch -d feat/123-short-name | Branches |
| Give up on a merge with conflicts | git merge --abort | Conflicts |
| Throw away my edits to a file | git restore file | Undo |
| Unstage a file but keep the edits | git restore --staged file | Undo |
| Fix the last commit (message or a forgotten file) | git commit --amend (rewrites history) | Rewriting history |
| Undo the last commit, keep the changes staged | git reset --soft HEAD~1 (rewrites history) | Undo |
| Undo a commit that is already pushed | git revert <sha> (adds a new commit) | Undo |
| Get back a deleted branch or a bad reset | git reflog, then git branch name <sha> | Undo |
| Park unfinished work, then bring it back | git stash push -u -m "wip", git stash pop | Rewriting history |
| Clean up my branch's commits before a PR | git rebase -i main (rewrites history) | Rewriting history |
| Fold a fix into an earlier commit | git commit --fixup <sha>, then git rebase -i --autosquash main | Rewriting history |
| Copy one fix onto a release branch | git cherry-pick <sha> | Rewriting history, Branches and releases |
| Get teammates' work without merging it yet | git fetch, then compare with origin/main | Remotes |
| Update my branch from the remote, linear history | git pull --rebase | Remotes |
| Push a new branch and track it | git push -u origin feat/123-short-name | Remotes |
| Push after a rebase, safely | git push --force-with-lease (never plain --force on shared branches) | Rewriting history |
| Mark a release | git tag -a v1.4.0 -m "v1.4.0", git push origin v1.4.0 | Branches and releases |
| Find the commit that broke something | git bisect start BAD GOOD, then git bisect run npm test | Code detective |
| Preview deleting untracked files | git clean -n (then -f to do it) | Undo |
| Look inside an object | git cat-file -p HEAD | Inside .git |
GitHub CLI in one breath
gh auth login once, then: gh repo create, gh issue create, gh pr create --fill, gh pr checks --watch, gh pr review --approve, gh pr merge --squash --delete-branch, gh run watch, gh release create v1.4.0 --generate-notes, and gh api for anything else (GitHub: remotes, clone, push, pull and authentication, Pull requests and code review, Project: ship a small app end to end).
VS Code shortcuts
These are VS Code's default bindings, checked against its default keybinding lists for each platform. Linux uses the Windows keys except where noted. A comma means "press the first combination, release, then the second". If a shortcut does nothing, run Preferences: Open Keyboard Shortcuts to see what your setup uses (VS Code essentials).
| Action | Windows / Linux | macOS |
|---|---|---|
| Command Palette | Ctrl+Shift+P or F1 | Cmd+Shift+P or F1 |
| Quick Open a file by name | Ctrl+P | Cmd+P |
| Settings | Ctrl+, | Cmd+, |
| Toggle the terminal | Ctrl+` | Ctrl+` |
| New terminal | Ctrl+Shift+` | Ctrl+Shift+` |
| Show or hide the side bar | Ctrl+B | Cmd+B |
| Explorer | Ctrl+Shift+E | Cmd+Shift+E |
| Search across files | Ctrl+Shift+F | Cmd+Shift+F |
| Source Control | Ctrl+Shift+G | Ctrl+Shift+G |
| Run and Debug view | Ctrl+Shift+D | Cmd+Shift+D |
| Extensions | Ctrl+Shift+X | Cmd+Shift+X |
| Problems panel | Ctrl+Shift+M | Cmd+Shift+M |
| Toggle line comment | Ctrl+/ | Cmd+/ |
| Select next match (multi-cursor) | Ctrl+D | Cmd+D |
| Add a cursor below | Ctrl+Alt+Down (Linux: Shift+Alt+Down) | Cmd+Option+Down |
| Move line down | Alt+Down | Option+Down |
| Copy line down | Shift+Alt+Down (Linux: Ctrl+Shift+Alt+Down) | Shift+Option+Down |
| Delete line | Ctrl+Shift+K | Cmd+Shift+K |
| Go to Definition | F12 | F12 |
| Find All References | Shift+F12 | Shift+F12 |
| Rename Symbol | F2 | F2 |
| Format Document | Shift+Alt+F (Linux: Ctrl+Shift+I) | Shift+Option+F |
| Quick Fix (light bulb) | Ctrl+. | Cmd+. |
| Go to line | Ctrl+G | Ctrl+G |
| Go to symbol in file (Outline) | Ctrl+Shift+O | Cmd+Shift+O |
| Go back after jumping | Alt+Left (Linux: Ctrl+Alt+-) | Ctrl+- |
| Split editor | Ctrl+\ | Cmd+\ |
| Markdown preview to the side | Ctrl+K, V | Cmd+K, V |
| Zen mode (Esc twice to leave) | Ctrl+K, Z | Cmd+K, Z |
| Start debugging / toggle breakpoint | F5 / F9 | F5 / F9 |
| Keyboard Shortcuts editor | Ctrl+K, Ctrl+S | Cmd+K, Cmd+S |
JavaScript gotchas
Each result below is real output from Node 24. Most of these catch every team at least once.
| You write | You get | Do this instead | Lesson |
|---|---|---|---|
0.1 + 0.2 | 0.30000000000000004 | Keep money as integer cents; format with Intl.NumberFormat | Data and money |
1999 * 0.15 (a 15% discount) | 299.84999999999997 | Math.round(1999 * 15 / 100) gives 300 | Data and money |
[10, 9, 1].sort() | [1, 10, 9] (sorted as text) | .sort((a, b) => a - b), or toSorted to avoid changing the array | Data and money |
'5' + 1 and '5' - 1 | "51" and 4 | Convert input first: Number(value) | JS basics |
0 == '' | true | Always === | JS basics |
typeof null | "object" | Check value === null directly | JS basics |
NaN === NaN | false | Number.isNaN(x) | JS basics |
qty || 5 when qty is 0 | 5 (zero is falsy) | qty ?? 5 only replaces null and undefined | JS basics |
const b = a; b.qty = 9 | a.qty is now 9 too | Copy: { ...a }, or structuredClone(a) for nested data | References |
{ ...order }, then change copy.lines[0] | The original order changes | Spread is shallow; copy nested parts too, or use structuredClone | References |
{ qty: 1 } === { qty: 1 } | false (two objects) | Compare fields, or IDs | References |
Object.freeze(o), then o.n.q = 2 | Works; freeze is shallow | Treat state as immutable by habit; freeze is not deep | References |
new Date('2026-10-07').getDate() | 7 in Lagos or Singapore, 6 in New York | Date-only strings are UTC; store ISO timestamps, format with a time zone | Data and money |
JSON.stringify({ d: new Date(0), u: undefined }) | {"d":"1970-01-01T00:00:00.000Z"} | Dates become strings, undefined disappears; parse dates back yourself | Data and money |
['1', '2', '3'].map(parseInt) | [1, NaN, NaN] | .map(Number) or .map((s) => parseInt(s, 10)) | Closures |
items.forEach(async (i) => { await save(i) }) | Code after it runs before any save finishes | for (const i of items) await save(i), or await Promise.all(items.map(save)) | Async JS |
for (var i ...) setTimeout(() => log(i)) | 3 3 3 | Use let: each loop turn gets its own i (prints 0 1 2) | Closures |
Number.MAX_SAFE_INTEGER + 2 | 9007199254740992 (wrong by 1) | Use BigInt or strings for very large IDs | Data and money |
sales.groupBy(...) | TypeError: sales.groupBy is not a function | Object.groupBy(sales, fn); check AI suggestions against the docs | Data and money, AI assistants |
Glossary
Plain definitions of the terms used most on the Developer track, each with the lesson that explains it.
- AGENTS.md
- A Markdown file in a repo that tells AI coding assistants how the project works: commands, layout and rules. Working with AI coding assistants
- Branch
- A movable name that points at a commit and moves forward as you commit; cheap to create and delete. Branches and merging
- Bundle
- The file or files a bundler produces from your source and its imports, ready to send to a browser or app. Performance and memory in JavaScript
- CI (continuous integration)
- Automatically building and testing every change, usually on each push and pull request. GitHub Actions: continuous integration
- CD (continuous delivery or deployment)
- Automatically releasing tested changes to an environment, with or without a final approval. Deploying and securing with GitHub Actions
- Change fail rate
- The share of deployments that need an immediate fix, such as a hotfix or a rollback. One of DORA's four keys. Your team's engineering playbook
- Closure
- A function together with the variables it captured from where it was created, which stay alive as long as the function does. Functions, scope and closures
- CODEOWNERS
- A file that maps paths to the people or teams who must be asked to review changes there; the last matching line wins. Pull requests and code review
- Commit
- A saved snapshot of the project plus author, date, message and a pointer to its parent commit. What Git really is: snapshots and the three areas
- Conventional Commits
- A message format such as
feat(api): add stock endpointthat tools can read to build changelogs and pick version numbers. Everyday Git: status, diff, log and good commits - CORS
- Cross-origin resource sharing: the browser rule that a page may call another origin's API only if that API's response headers allow it. JavaScript in the browser
- Detached HEAD
- When HEAD points straight at a commit instead of a branch; new commits there are easy to lose unless you create a branch. Inside the .git folder: objects, refs and HEAD
- DOM
- Document Object Model: the browser's tree of objects for a page, which JavaScript reads and changes. JavaScript in the browser
- DORA metrics
- Deployment frequency, change lead time, change fail rate and recovery time: measures of how fast and how safely a team delivers. Your team's engineering playbook
- Environment (GitHub)
- A named deployment target such as staging or production, with its own secrets and protection rules like required approvals. Deploying and securing with GitHub Actions
- Environment variable
- A named text value, such as
PATHorSTORE_ID, that each program inherits from the one that started it; Node reads them throughprocess.env. The terminal without fear - ES modules
- The standard JavaScript module system using
importandexport; Node uses it when"type": "module"is set. Prototypes, classes and modules - Event loop
- The mechanism that lets single-threaded JavaScript run queued callbacks one at a time, microtasks first, so it never waits idle on I/O. The event loop
- Exit code
- The number a program returns when it ends: 0 for success, anything else for failure. CI steps, hooks and
&&all decide from it. The terminal without fear - Fast-forward merge
- A merge where the branch pointer simply moves ahead because no new commits exist on the target; no merge commit is created. Branches and merging
- Fetch vs pull
- Fetch downloads new commits and updates
origin/main; pull is fetch plus merge or rebase into your branch. GitHub: remotes, clone, push, pull and authentication - Flat config
- ESLint's configuration format: an
eslint.config.jsthat exports an array of config objects applied in order. ESLint 10 reads no other format. VS Code for teams: formatting, linting and shared settings - Formatter
- A tool such as Prettier that rewrites code layout into one consistent style without changing what the code does. VS Code for teams: formatting, linting and shared settings
- Garbage collection
- The engine freeing memory for objects that can no longer be reached from any root. Performance and memory in JavaScript
- GitHub Actions
- GitHub's automation system: YAML workflows that run jobs on hosted runners when events such as a push or PR happen. GitHub Actions: continuous integration
- HEAD
- Git's pointer to what you have checked out, usually a branch name. Inside the .git folder: objects, refs and HEAD
- Heap snapshot
- A file listing every live object in a JavaScript process and what holds it, used to find memory leaks. Performance and memory in JavaScript
- Hidden class
- V8's internal record of an object's layout; objects built with the same fields in the same order share one and are faster to read. Performance and memory in JavaScript
- Hotfix
- A small, urgent fix released outside the normal schedule, through the same checks, usually as a patch version. Branching strategies, releases and versions, Project: ship a small app end to end
- Index (staging area)
- The list of changes that will go into the next commit;
git addputs changes there. What Git really is: snapshots and the three areas - JIT compiler
- The part of the engine that turns frequently run JavaScript into fast machine code while the program runs. Performance and memory in JavaScript
- Lead time for changes
- How long a change takes from first commit to running in production. Your team's engineering playbook
- Linter
- A tool such as ESLint that reads code and flags likely bugs and rule breaks without running it. VS Code for teams: formatting, linting and shared settings
- Lockfile
package-lock.json: the exact version and hash of every installed package, so every machine installs the same tree. Node.js and npm- LRU cache
- A cache with a size limit that removes the least recently used entry when full. Performance and memory in JavaScript
- Memory leak
- Memory that stays in use because something still references objects the program no longer needs. Performance and memory in JavaScript
- Merge conflict
- When two branches changed the same lines and Git needs a person to decide the result. Merge conflicts without panic
- Microtask
- A high-priority callback, such as a promise reaction, that runs before the event loop picks the next task. The event loop
- npm ci
- Installs exactly what the lockfile says, from scratch, and fails if
package.jsonand the lockfile disagree; use it in CI. Node.js and npm - OIDC (in Actions)
- A way for a workflow to get a short-lived cloud credential by proving who it is, so no long-lived secret is stored. Deploying and securing with GitHub Actions
- PATH
- The list of folders the shell searches, in order, when you type a program's name; the first match runs. The terminal without fear
- Pre-commit hook
- A script Git runs just before creating a commit; if it exits non-zero, there is no commit. husky installs it and lint-staged keeps it fast. VS Code for teams: formatting, linting and shared settings
- Promise
- An object for a value that arrives later; it is pending, then fulfilled or rejected, and
awaitwaits for it. Async JavaScript: callbacks, promises and async/await - Prototype chain
- The chain of objects JavaScript searches when a property is not found on the object itself. Prototypes, classes and modules
- Prototype pollution
- An attack where input such as a
__proto__key makes code write ontoObject.prototype, changing every object. Security and quality in JavaScript projects - Provenance
- A signed record linking a published package to the source commit and CI workflow that built it. Security and quality in JavaScript projects
- Pull request (PR)
- A request to merge one branch into another, with the diff, CI checks, review and discussion in one place. Pull requests and code review
- Rebase
- Replaying your commits on top of another commit to make history linear; it rewrites those commits. Rewriting history safely: rebase, squash, cherry-pick, stash
- Reflog
- Git's local diary of where HEAD and branches pointed, used to recover lost commits. Undo anything: restore, reset, revert and reflog
- Remote
- A named link to another copy of the repository, usually
originon GitHub. GitHub: remotes, clone, push, pull and authentication - Reset vs revert
- Reset moves a branch pointer back (rewrites history); revert adds a new commit that undoes an old one (safe after pushing). Undo anything: restore, reset, revert and reflog
- Ruleset
- A set of GitHub rules on branches or tags, such as required reviews, required checks and no force pushes. Branching strategies, releases and versions
- Runner
- The machine that runs a GitHub Actions job; GitHub-hosted runners are fresh virtual machines for each job. GitHub Actions: continuous integration
- Runtime
- A JavaScript engine plus the abilities a program can call: the page and
fetchin a browser, files, the network and environment variables in Node.js. How code becomes a running program - Semantic versioning
- MAJOR.MINOR.PATCH: breaking change, new feature, bug fix.
^1.4.0allows any 1.x from 1.4.0 up. Node.js and npm - Shallow copy
- A copy of an object's top level only; nested objects are still shared with the original. Objects, arrays and references
- Squash merge
- Merging a PR as a single new commit on the target branch, combining all its commits. Pull requests and code review
- Supply-chain attack
- An attack that reaches you through a dependency or tool you trust, such as a hijacked npm package. Security and quality in JavaScript projects
- Tag
- A fixed name for one commit, used to mark releases such as
v1.4.0. Branching strategies, releases and versions - Trunk-based development
- Everyone merges small changes into
mainat least daily, keeping it releasable, often behind feature flags. Branching strategies, releases and versions - Type narrowing
- TypeScript working out a more specific type after a check, such as
if (r.ok)on a union. TypeScript for a JavaScript team - Workflow
- A YAML file in
.github/workflows/that says when to run and which jobs and steps to run. GitHub Actions: continuous integration - Workspace settings
- VS Code settings in a project's
.vscode/settings.json; they override each person's user settings for that project. VS Code essentials - XSS (cross-site scripting)
- Getting attacker-controlled script to run in your page, usually because user text was inserted as HTML. Security and quality in JavaScript projects
What to read next
- Pro Git by Scott Chacon and Ben Straub, free at git-scm.com/book. The definitive Git book. Chapters 2, 3 and 7 go deeper on everything in the Git from the Inside course; chapter 10 is the inside view from Inside the .git folder: objects, refs and HEAD.
- GitHub Docs at docs.github.com. The source of truth for pull requests, rulesets, Actions, Pages and security features. Start with the Actions and "Code security" sections.
- VS Code documentation at code.visualstudio.com/docs. Short, practical pages on editing, debugging, source control and AI features. The debugging and Node.js pages pair with Errors, debugging and testing and Performance and memory in JavaScript.
- MDN JavaScript Guide at developer.mozilla.org. The best reference for the language and browser APIs. When unsure whether a method exists, check here first.
- The Modern JavaScript Tutorial at javascript.info. A clear, free course from basics to the event loop, with exercises. A good companion to JavaScript Deep Dive.
- You Don't Know JS Yet by Kyle Simpson, free on GitHub. "Get Started" and "Scope & Closures" explain how the language really works, especially for Functions, scope and closures.
- The TypeScript Handbook at typescriptlang.org. Read "Everyday Types", "Narrowing" and "Generics" after TypeScript for a JavaScript team.
- Node.js documentation: the Learn section for guides (diagnostics, the test runner, TypeScript) and the API reference for every built-in module.