Git & GitHub

Step 1 of 13

Your first save point

init, status, add, commit

Git keeps save points of a folder, called commits. You can always go back to one, compare two, or see who changed what. That is the whole idea; everything else is how.

This folder has the start of a café website: a menu and a README. Git is not watching it yet. git init makes the folder a repository. git status tells you what Git sees — run it after every step, it never changes anything.

Saving is two moves, not one. git add puts files in the staging area, a waiting room for the next commit. git commit -m "a message" then saves everything in the waiting room as one commit.

Goal
  • This folder is a Git repository
  • There is at least one commit
  • The commit holds both menu.txt and README.md
  • Nothing is left uncommitted
~/cafe

Type a command below, or tap one of the chips. git status is always a good start.

$
Files in ~/cafe
Where your changes are
Folder
what you edit
README.mdnot tracked
menu.txtnot tracked
Staging area
goes in the next commit
not a repository yet
Last commit
saved history
not a repository yet
History on your computer

No repository here yet.

Sign in to save your progress. The goal list above ticks itself either way.