Lesson 1.1. What Is VCS and Why Git

Friday, 6:40 PM

You're editing functions.php on a client's live site over FTP. Save, refresh the page — white screen. A backup? There was a functions-old.php somewhere… or did a teammate overwrite it yesterday?

Your project folder looks familiar:

TEXT
my-plugin/
my-plugin-backup/
my-plugin-final/
my-plugin-final-v2/
my-plugin-final-v3-fixed/
my-plugin-final-v3-fixed-REALLY.zip

Which one works? What changed between v2 and v3? Who did it, and why? "I don't know" costs hours of work and the client's nerves. This is exactly the problem version control solves.

Goal

In 10 minutes, understand what a version control system is and what problems it solves for a WordPress developer — lost edits, "who broke this?" and risky FTP deploys; see how centralized SVN differs from distributed Git and why the whole industry, WordPress core, Gutenberg and WooCommerce included, works with Git; then install Git and check that it runs.

VCS in one sentence

A Version Control System is a time machine for your project: it remembers every saved version, who made it and why, and lets you go back to any of them in seconds.

Without VCSWith Git
final-v3-fixed-REALLY.zipone folder, the whole history inside
"Who broke this?"git log — author, date, reason
"What did it look like yesterday?"git diff — every changed line
White screen → panicgit restore → working version in a second
Two people edit one file — someone loses workbranches and merging

Centralized or distributed

flowchart TB
  subgraph C["Centralized (SVN)"]
    direction TB
    S[("Server<br/>entire history")]
    A1["Developer A<br/>files only"] <--> S
    B1["Developer B<br/>files only"] <--> S
  end
  subgraph D["Distributed (Git)"]
    direction TB
    G[("GitHub<br/>full history")]
    A2[("Developer A<br/>full history")] <--> G
    B2[("Developer B<br/>full history")] <--> G
  end
  • Centralized (SVN): history lives on a single server. No connection — no commits and no history. Server down — history gone.
  • Distributed (Git): every clone is a full copy of the repository. You commit on a plane, and every laptop on the team is a backup.

Why Git

  • Born out of pain. 2005: Linux kernel developers lost free access to their VCS. Linus Torvalds wrote his own in a few weeks — fast, distributed, and designed so history can't be silently corrupted.
  • Snapshots, not patches. Every commit is a snapshot of the whole project. Unchanged files aren't copied; they point to the already stored version.
  • Almost everything is local. History, diffs and branches work offline, so they're instant.
  • It's the industry standard. GitHub, GitLab, Bitbucket, CI/CD, hosting deploys — everything is built around Git. In WordPress developer job posts, Git isn't a "nice to have", it's a baseline requirement.

What about WordPress?

WordPress is an interesting example of both worlds:

  • WordPress core is still developed in SVN (core.trac.wordpress.org), but there's an official Git mirror on GitHub (wordpress-develop) where you can propose changes as a pull request.
  • The wordpress.org plugin directory accepts releases via SVN. So the typical plugin author's path is: develop in Git and GitHub → deploy to SVN automatically with GitHub Actions. We'll build this pipeline in Module 7.
  • Gutenberg, WooCommerce, WP-CLI live on GitHub: issues, pull requests, code review.

Takeaway: knowing enough SVN to read it is useful, but you'll be working in Git.

Key concepts

  • VCS stores the history of changes: what, who, when and why
  • Centralized VCS (SVN): one copy of the history on a server
  • Distributed VCS (Git): every clone has the full history
  • Git stores snapshots, not differences between files
  • Almost all operations are local, so they're fast

Commands / artifacts

BASH
git --version

Installation:

  • macOS: xcode-select --install or brew install git
  • Windows: git-scm.com (includes Git Bash)
  • Linux: sudo apt install git (Debian/Ubuntu)

Common mistakes

SymptomCauseFix
git: command not foundGit isn't installedinstall from git-scm.com or with a package manager
Old Git version (e.g. 2.17)the OS's bundled Gitupdate via brew / installer; this course needs 2.28+ (init.defaultBranch)
"Git = GitHub"mixing up the conceptsGit is a tool on your computer, GitHub is a repository hosting service

Practice

Check that Git is installed and see its version. Then try the same in the terminal below.

git — Module 1. Git Basics

Bonus: think back to your last "white screen" on a site. How long did it take to find a working version? By the end of Module 2, the same rollback will take a single command.

Interview Questions

In a centralized VCS (SVN), history is stored on a single server: without a connection to it, you can't commit or view history. In a distributed VCS (Git), every clone is a full copy of the repository with its entire history. That's why most operations are local and fast, and losing the server doesn't mean losing the history.

Snapshots. Every commit is a snapshot of the state of all project files; unchanged files aren't copied but point to the already stored version. Git computes diffs on the fly when you ask for them. Delta compression in pack files is just an on-disk storage detail, not the data model.

Git is a version control system that runs locally on your computer. GitHub is a cloud service that hosts Git repositories and adds team tools: pull requests, code review, issues, GitHub Actions. Git works without GitHub; alternatives to GitHub include GitLab and Bitbucket.

SVN on wordpress.org is only the release channel for a plugin. The actual development, team work, code review and CI happen in Git (mostly on GitHub), and deploying to SVN is automated, for example with GitHub Actions.

Save your progress

Sign in or create a free account to mark lessons as completed and continue the whole course. You will come back to this lesson.