Spark Learn

Explainer · FOUNDATIONS / INTRO

Git and GitHub

A save system for your work, and a time machine. When agents are changing your files, Git is how you stay in control: commit what is good, go back when it is not, and sync across machines.

Updated 2026-05-29 Spark Learn

Git is a save system for your project. Every change is a snapshot you can return to. When agents are editing your files, Git is how you stay in control: keep what is good, go back when it is not, and sync across machines. You do not need to memorize commands. You need the picture.

Your project is a series of snapshots

Each dot is a commit, a saved state of the whole project. They run left to right, oldest to newest. The line that lifts up and rejoins is a branch. Click any commit to travel back to it.

f6d

Publish

The latest snapshot, the version that ships.

now This is the latest commit. Your project looks exactly like this right now.

Where your work lives

A change moves through three places before it reaches GitHub. Step through it.

01 / 04

Working directory

The files as they are on your machine right now, including the edits you or an agent just made.

Your machine and GitHub stay in sync

GitHub holds the shared copy. Your machine holds yours. Push sends your work up, pull brings new work down, sync does both. Try it.

Your machine local

  • c3 Agent drafts the proposal not pushed
  • b2 Add the project brief
  • a1 Set up the workspace

GitHub remote

  • d4 Teammate fixes the pricing not pulled
  • b2 Add the project brief
  • a1 Set up the workspace
Out of sync, both sides have new work

The words you will actually use

Repository
Your project plus its full history. Often shortened to 'repo'.
Clone git clone
Make your own local copy of a repo from GitHub.
Commit git commit
A saved snapshot of the project at a moment in time, with a message.
Staging git add
Choosing which changes go into the next commit.
Branch git branch
A parallel line of work that does not affect the main version until you merge it.
Merge git merge
Bring a branch's commits back into the main line.
Push git push
Send your local commits up to GitHub.
Pull git pull
Bring new commits down from GitHub to your machine.
Go back git checkout
Return to an earlier commit. Nothing is lost; the history stays intact.
Remote
A copy of the repo somewhere else, usually GitHub.
origin
The default name for your main remote, your GitHub repo.
main
The primary branch, the official version of the project.