Chapter C48 · Interactive Course
A workspace and its change history
Folders, repositories, diffs, commits, worktrees and publication.
Core Learning Concept
Inspect the proposed repair through its files, change history, and check results. Confirm the working folder, read the diff with surrounding code, and distinguish editing, recording history, sharing, and deployment. Use the evidence for each state rather than treating a summary saying “fixed” as proof that users have the change.
What You’ll Learn in This Chapter
-
The terminal runs commands in a folder
Identify the working directory before a command.
A terminal runs commands in a process with a current working directory. A relative path is usually resolved from that directory unless the command specifies otherwise. The editor and agent may use different folders. Confirm the location before interpreting file paths or running a project command.
-
A repository tracks a project
Separate a folder from its version-history repository.
A repository is a project tracked by a version-control system such as Git. It stores recorded history as well as supporting work on current files. A folder is not automatically a repository. Other recovery mechanisms may exist, but version control provides an explicit way to inspect and restore recorded changes.
-
A diff shows a proposed change
Read added and removed lines.
A diff highlights added and removed lines against existing code. Never rely on verbal summaries when evaluating code modifications; inspect the exact deletions and insertions to understand true behavioral changes.
-
A commit records a snapshot
Distinguish edited, staged and committed states.
In Git, editing changes the working files, staging selects content for a commit, and committing records a snapshot in local history. Backups and other recovery options may also exist. A deliberate checkpoint makes later changes easier to compare and recover, but committing does not publish them to users.
-
Branches and worktrees separate work
Explain separate histories and separate working folders.
A Git branch defines an independent commit timeline, whereas a worktree checks out files into a distinct working directory. Both isolate changes, but neither isolates shared local databases or running port listeners.
-
A test runs a check
Distinguish a test command from its actual result.
Software tests provide rigorous evidence only through actual execution commands, environment variables, exit codes, and assertion logs. Never mistake an agent's persuasive verbal assurance of success for genuine verified test execution.
-
Local work is different from publication
Distinguish a commit, remote push and deployed change.
A local edit changes a checkout; a commit records it; a push shares Git history; deployment changes a served environment. Projects can use different workflows, but none of these states should be assumed from another. Verify the environment users actually reach before calling a local repair a release.
-
Review before accepting
Inspect a fictional change, its test output and history, and mark what is edited, tested, saved in history and still unpublished.