Git Basics

Swap a folder of my-plugin-final-v3-fixed copies for one Git repository where no change ever gets lost.

3 lessons8 interview questions3 terminal practices

my-plugin-final-v3-fixed-REALLY.zip is not version control. Which copy works? What changed between v2 and v3, who changed it, and why? In this module you replace the folder of copies with one repository that answers those questions in seconds.

CourseGit Basics Course · Module 1 of 7 · Stage 1 "On your own"
LearnHow Git stores changes: three file states, three areas, and your first configured repository
How3 short lessons on a real my-plugin project, commands in the browser terminal, interview questions after every lesson

Where a change lives

flowchart LR
  WD["Working directory<br/>modified"] -- "git add" --> ST["Staging area<br/>staged"]
  ST -- "git commit" --> RP[("Repository<br/>committed")]
  RP -- "git restore / switch" --> WD
  classDef area fill:#fff7ed,stroke:#EE5133,color:#7c2d12
  classDef repo fill:#EE5133,stroke:#9a2a14,color:#ffffff
  class WD,ST area
  class RP repo

Three areas, one path. Once you see it, git status stops being a mystery, and a stray var_dump() no longer slips into a commit.

Before → after

BeforeAfter Module 1
my-plugin-final-v2, -v3-fixed, .zipone my-plugin repository with history
"Who changed this?" — nobody knowsevery snapshot has an author, a date and a message
Commits signed admin@MacBook-Pro.localgit config with your real name and email
Copying the project over FTPgit init for a new project, git clone for an existing one

You'll be able to answer

  • How does a distributed VCS differ from a centralized one?
  • What does Git store: snapshots or diffs?
  • Why does a WordPress developer need Git if wordpress.org uses SVN?

Lessons in this module 3 lessons