SovranCode
Git and GitHub: History, Collaboration, and Review Version Control, Snapshots, and Collaboration
This device
Course contentsVersion Control, Snapshots, and Collaboration · 39 topics

1. Git Foundations

Why History MattersVersion Control, Snapshots, and CollaborationGit, GitHub, and the Rest of the ToolchainInstall Git and Configure IdentityPlannedWorking Tree, Index, and Object DatabasePlannedinit, status, add, and the First CommitPlanned.gitignore, Secrets, and What Not to CommitPlannedUnit Project: Personal Learning Journal RepositoryProject

2. Everyday History

Reading Commits with log and showPlanneddiff: Working Tree, Index, and CommitsPlannedAmending, Restoring, and Resetting SafelyPlannedrevert versus reset: Public and Private HistoryPlannedstash, Worktrees, and Unfinished WorkPlannedUnit Project: Recover a Messy Local RepositoryProject

3. Branches and Integration

Branches, HEAD, and Detached HEADPlannedMerging: Fast-Forward and Merge CommitsPlannedMerge Conflicts and How to Resolve ThemPlannedRebase, Interactive Rebase, and When Not ToPlannedcherry-pick, Tags, and Annotated HistoryPlannedUnit Project: Feature Branch with a Real ConflictProject

4. Remotes and GitHub

remotes, fetch, pull, and pushPlannedHTTPS, SSH, and Credential HelpersPlannedGitHub Repositories, Visibility, and READMEPlannedForks, origin, upstream, and SyncingPlannedGitHub Issues and Discussing WorkPlannedReleases, Tags, and GitHub PagesPlannedUnit Project: Publish and Sync Two ClonesProject

5. Collaboration on GitHub

Pull Requests as a Review SurfacePlannedCode Review: Comments, Requests, and MergingPlannedGitHub Flow, Trunk-Based Development, and Git FlowPlannedProtected Branches, Required Checks, and CODEOWNERSPlannedTemplates, Labels, and Project BoardsPlannedContributing to Other People's RepositoriesPlannedUnit Project: Open, Review, and Merge a Pull RequestProject

6. Automation and Professional Git

GitHub Actions for Tests and ChecksPlannedGit Internals: Blobs, Trees, Commits, and RefsPlannedreflog, bisect, blame, and RecoveryPlannedSigning, Tokens, and Secret HygienePlannedUnit Project: Team Repository with CI and ProtectionProject
Git and GitHub: History, Collaboration, and Review3 complete · 36 planned

1. Git Foundations

Why History MattersVersion Control, Snapshots, and CollaborationGit, GitHub, and the Rest of the ToolchainInstall Git and Configure IdentityPlannedWorking Tree, Index, and Object DatabasePlannedinit, status, add, and the First CommitPlanned.gitignore, Secrets, and What Not to CommitPlannedUnit Project: Personal Learning Journal RepositoryProject

2. Everyday History

Reading Commits with log and showPlanneddiff: Working Tree, Index, and CommitsPlannedAmending, Restoring, and Resetting SafelyPlannedrevert versus reset: Public and Private HistoryPlannedstash, Worktrees, and Unfinished WorkPlannedUnit Project: Recover a Messy Local RepositoryProject

3. Branches and Integration

Branches, HEAD, and Detached HEADPlannedMerging: Fast-Forward and Merge CommitsPlannedMerge Conflicts and How to Resolve ThemPlannedRebase, Interactive Rebase, and When Not ToPlannedcherry-pick, Tags, and Annotated HistoryPlannedUnit Project: Feature Branch with a Real ConflictProject

4. Remotes and GitHub

remotes, fetch, pull, and pushPlannedHTTPS, SSH, and Credential HelpersPlannedGitHub Repositories, Visibility, and READMEPlannedForks, origin, upstream, and SyncingPlannedGitHub Issues and Discussing WorkPlannedReleases, Tags, and GitHub PagesPlannedUnit Project: Publish and Sync Two ClonesProject

5. Collaboration on GitHub

Pull Requests as a Review SurfacePlannedCode Review: Comments, Requests, and MergingPlannedGitHub Flow, Trunk-Based Development, and Git FlowPlannedProtected Branches, Required Checks, and CODEOWNERSPlannedTemplates, Labels, and Project BoardsPlannedContributing to Other People's RepositoriesPlannedUnit Project: Open, Review, and Merge a Pull RequestProject

6. Automation and Professional Git

GitHub Actions for Tests and ChecksPlannedGit Internals: Blobs, Trees, Commits, and RefsPlannedreflog, bisect, blame, and RecoveryPlannedSigning, Tokens, and Secret HygienePlannedUnit Project: Team Repository with CI and ProtectionProject
PREVIOUS LESSONWhy History Matters
NEXT LESSONGit, GitHub, and the Rest of the Toolchain
Git foundations 50 min

Version Control, Snapshots, and Collaboration

Version control is not a folder that happens to contain old files. It is a model of complete project states connected by ancestry. Once you can read that model, branches become divergence, merges become integration, and collaboration stops looking like a sequence of mysterious buttons.

What you will leave with

You will be able to distinguish snapshots from deltas, read parent links in a commit graph, explain centralized versus distributed version control, and find the common state that independent work must use when it reunites.

Four ideas hold the model together

SnapshotA complete tracked project state, not merely the latest changed lines.
ParentThe earlier state from which a new recorded state was made.
DivergenceIndependent work that begins from the same shared snapshot.
IntegrationA deliberate result that combines compatible decisions.

What version control actually controls

A version control system manages selected project files and the relationships among recorded states. It gives each state identity, connects it to earlier states, and lets people compare, restore, and combine work. It does not automatically understand whether the code is correct. It preserves evidence so humans and tools can judge that question.

The word version is easy to misread. A version is not necessarily a release such as 2.4.0. During development, every meaningful recorded state can be a version. Most never become a public release; they still matter because they show how the project reached its current form.

Selected scope

The repository records files you choose to track. Downloads, secrets, build output, and the rest of the machine are separate concerns.

Stable identity

A recorded state has an identifier independent of filenames such as final-v3.

Ancestry

A state normally names one or more parents, so history is a graph rather than a bag of copies.

Reviewable difference

The system can derive what changed between complete states without pretending the difference is the whole state.

Snapshots are complete states, not loose patches

Suppose snapshot B changes only header.css. B still describes the README, source files, images, and every other tracked path. Conceptually, B is the complete project. Internally, Git can reuse unchanged file objects instead of copying identical bytes. That is an efficiency detail, not a different mental model.

Difference is computed between snapshots

A diff answers “how do these two complete states differ?” It does not mean the later state stores only a patch. This distinction matters when you restore, branch, and merge.

A ──▶ B ──▶ C
      parent  parent

A  Initial project
B  Add navigation
C  Fix mobile layout

In this line, C names B as its parent and B names A. The arrows describe ancestry, not time alone. Two snapshots could be created minutes apart and still belong to different lines of work if they name different parents.

QUICK CHECK

Test what you learned

What word names the earlier snapshot from which a new commit was created?

History is a graph, not a stack of folders

A straight line is only the simplest graph. Collaboration produces siblings: two people can start from B and each record a different next state. Neither D nor E is automatically wrong. They preserve two valid continuations of the same history.

          D  Add search
         /
A ──▶ B
         \
          E  Redesign header

D and E share B as their last common snapshot.

B is the common ancestor. To integrate D and E, a tool compares B→D and B→E. If one side adds a file while the other edits a different file, the changes may combine automatically. If both make incompatible edits to the same place, a person must decide the intended result. That later decision becomes a new snapshot.

A conflict is not corruption

A conflict means the tool cannot safely infer one result from two decisions. The history did its job: it exposed the exact ambiguity instead of silently overwriting somebody.

Centralized and distributed version control

Centralized model

One primary history service

  • Developers check work into a central server.
  • Server availability may be required for history operations.
  • The central repository is the authoritative record.
  • Working copies may contain less history locally.
Distributed model

Each clone carries history

  • A normal Git clone includes repository history.
  • Commits, comparisons, and branches work locally.
  • A shared server is a coordination choice, not Git’s engine.
  • Several repositories can exchange the same commits.

Distributed does not mean “everyone works alone” or “there is no main repository.” Teams commonly agree that a GitHub repository is the shared meeting place. The architectural point is that the local clone remains a real repository capable of recording and reading history without asking GitHub for permission.

Collaboration is movement through the graph

  1. 01
    Share a base

    People begin from a known snapshot, so later differences have a common reference.

  2. 02
    Record independently

    Each person makes one or more snapshots whose parent identifies where their work began.

  3. 03
    Compare decisions

    Review examines what each line changed relative to the shared base.

  4. 04
    Integrate deliberately

    A merge or replay creates an agreed continuation without erasing the evidence.

This model scales from one learner on a laptop to a large team. A solo developer still diverges when experimenting on a branch. A team still needs a human decision when two technically valid changes express incompatible product choices.

Worked example: two edits, one shared base

At B, a site has a navigation bar and a blank search area. Noor records D, which implements search. Eli records E, which renames navigation labels. Because both started from B, the review can isolate each decision. If they touched separate lines, the integrated state F can include both. If each renamed the same label differently, F requires a product decision.

B → D

Add the search form and keyboard label. The search decision is reviewable against the shared base.

B → E

Rename “Learn” to “Courses.” The navigation decision is reviewable against the same base.

D + E → F

Combine both when compatible. F records the reviewed result and points back to the integrated history.

If both edit one label

Stop and choose the intended wording. Version control identifies the conflict; it cannot own the product decision.

QUICK CHECK

Test what you learned

What two-word phrase describes B when D and E both descend from it?

Independent lab: draw the collaboration graph

On paper, draw snapshots A→B→C for a three-step project. From B, draw a second child D. Give C and D different change messages. Then add E as an integrated result. Under the graph, answer:

  • Which snapshot is the common ancestor of C and D?
  • Which two comparisons reveal the independent work?
  • What decision would require a person rather than automatic combination?
  • Why is E a complete project state rather than a bag of two patches?
Lab review criteria

Every arrow must mean “child names parent.” C and D must share B. Your E must describe an intentional complete result, and your conflict example must identify an ambiguity instead of calling all simultaneous edits conflicts.

Common mistakes to remove now

“A commit is a diff.”

A commit identifies a snapshot and its parent. A diff is derived by comparing states.

“Distributed means no shared server.”

Teams can coordinate through GitHub while every clone remains a local repository.

“Branches duplicate the project.”

Branches will be movable names for graph positions, not copied project folders.

“Conflicts mean Git failed.”

Git correctly refuses to invent intent when independent decisions cannot combine safely.

Lesson review

A version control system records complete selected project states and their ancestry. Git’s distributed design gives each clone real local history. Parent links form a graph; siblings reveal divergence; a common ancestor provides the baseline for integration. Diffs explain change between snapshots, while conflicts expose decisions that automation cannot safely make.

  • I can explain why a snapshot is complete even when most files are unchanged.
  • I can read parent and child relationships in a simple history graph.
  • I can distinguish centralized coordination from Git’s distributed repository model.
  • I can find the common ancestor of two divergent lines of work.
  • I can explain why a conflict requires intent rather than a more aggressive automatic guess.
KNOWLEDGE CHECK

Check the snapshot graph model

Answer every question before checking. Use each explanation to connect snapshots, ancestry, and collaboration.

01What does a Git-style snapshot represent?
02Why is a commit graph more useful than a numbered list of folders?
03Two commits both name B as their parent. What happened?
04What is the defining property of distributed version control?
05If one file did not change between snapshots B and C, what must Git conceptually preserve?
06What fact is needed before two independent changes can be integrated safely?
07Which statement best separates a backup from version control?
PREVIOUS LESSONWhy History Matters
NEXT LESSONGit, GitHub, and the Rest of the Toolchain
ON THIS PAGEVersion Control, Snapshots, and CollaborationLesson mapWhat VCS controlsSnapshots, not patchesHistory graphCentralized vs distributedCollaboration modelWorked exampleIndependent labCommon mistakesLesson reviewKnowledge check
Course contents