Tech Vocabulary/
Lesson

If you've ever worked on a document with multiple people, you know the chaos: "Final_v2_ACTUAL_FINAL.docx". Now imagine that with hundreds of files and dozens of developers. That's what Git solves.

What is Git and why it matters

Git is a version control system that remembers every change ever made to code, who made it, and why. Everyone works on their own copy of the codebase, and Git tracks how all those copies fit together.

The business case: When something breaks, Git tells you exactly what changed and who changed it. New developers can see the entire project history. Mistakes can be rolled back to any previous version.

Under the hood
Git stores changes as "commits", snapshots of your code at specific moments. Each commit has a unique ID and points back to the previous commit, creating an unbreakable chain of history.
AI pitfall
AI tools generate generic commit messages like "Update code" that tell you nothing. When investigating a production incident, useless messages make it impossible to understand the history. Always insist on descriptive commit messages.
02

Commits, branches, and merges

Commits: Save points in your code

A commitWhat is commit?A permanent snapshot of your staged changes saved in Git's history, identified by a unique hash and accompanied by a message describing what changed. captures the exact state of your code at a moment, with a message explaining what changed, like "Fix login button on mobile" or "Add password reset feature". Good commit messages tell the story of what happened to the codebase.

Branches: Parallel versions of code

Branches let developers work on different features without interfering with each other. The main branch (often called main) is the "source of truth", the official version that customers use. To add a feature, developers create a new branch, work on it in isolation, then merge it back when it's ready.

Example: Your team is building a new checkout flow. One developer works on the payment form, another on the confirmation screen, a third fixes a cart bug. Each creates their own branch, works independently, and merges when everything works.

Merges: Combining branches

When a feature is ready, the developer merges their branch back into main. Git combines the changes automatically, most of the time. When two developers changed the same line, that's a "merge conflictWhat is merge conflict?A situation where Git can't automatically combine changes from two branches because both modified the same lines, requiring you to manually choose which version to keep.," and someone must manually decide which version to keep.

03

Pull requests: Code review before it goes live

A pull requestWhat is pull request?A proposal to merge code changes into a shared branch, where teammates review the diff before it's accepted. (PR) is a proposal: "I've made changes on my branch. Please review them before we merge to main."

The PR process:

  1. Developer finishes their feature on a branch
  2. They open a pull request describing what changed and why
  3. Other developers review, leave comments, approve or request changes
  4. Once approved, the branch is merged into main

Good to know
PRs often trigger automated checks too, tests run, code quality tools scan for issues, and deployment previews are generated. This catches problems before a human even looks at the code.
04

Code reviews: Catching issues early

Code reviews aren't about catching mistakes. They're about sharing knowledge, catching bugs before customers do, ensuring maintainability, and keeping coding standards consistent.

The key questions: "Would I understand this code six months from now?" "Does this solve the problem in the simplest way?" "Are there edge cases we haven't considered?"

05

Common Git workflows

GitFlow: Structured and predictable

Two permanent branches: main (production-ready) and develop (integration). Feature branches split off develop, and when a release is ready, develop merges into main. Best for teams with scheduled releases.

Trunk-based developmentWhat is trunk-based development?A workflow where all developers commit frequently to a single shared branch, relying on feature flags to hide incomplete work.: Fast and continuous

Everyone commits directly to main or merges via very short-lived feature branches (hours, not weeks). Best for teams doing continuous deployment multiple times per day.

WorkflowBranch structureRelease frequencyBest for
GitFlowmain + develop + feature branchesScheduled (weekly/monthly)Teams with formal release cycles
Trunk-basedMostly main onlyContinuous (multiple times daily)Teams doing continuous deployment
06

Quick reference: Git terminology

TermWhat it meansBusiness analogy
CommitA snapshot of code changesSaving a document version
BranchA parallel version of the codeWorking on a copy of a document
MergeCombining branchesMerging two document versions
Pull requestRequest to merge codeAsking for approval before publishing
Repository (repo)The project's folder with all its historyA filing cabinet with every version of every document
CloneDownloading a copy of the repositoryMaking a photocopy of the filing cabinet