git status, log, and .gitignore
A free lesson from Swipe Coding · Ship It, level 2 · updated October 2026
By the Swipe team, founded by Colin · how we make lessons
git status shows you the current state of your project: which files are changed but not yet staged, which are staged and ready to commit, and which aren't being tracked at all. Running it constantly — before add, before commit, whenever you're unsure — is one of the simplest habits that prevents most Git mistakes, since it never changes anything, only reports.
$ git status On branch main Changes not staged for commit: modified: index.js
git log shows the project's full commit history — each commit's unique ID, author, date, and message, newest first. This is how you actually use all that history you've been building: scrolling back to see what changed and when, or finding the exact commit to compare against or return to.
$ git log
commit a1b2c3d...
Author: Maya
Date: Tue Sep 1
Add the login formRunning git status changes or commits any files.
Not everything belongs in version control — things like dependency folders, build output, or files containing secrets (API keys, passwords) should never be committed. A .gitignore file, placed in the project's root folder, lists file and folder patterns that Git should simply ignore — it never even offers to stage them, no matter how many times you run git add ..
node_modules/ .env *.log
A file named ____ lists file and folder patterns that Git should never track or stage.
Why should a file containing API keys or passwords typically be listed in .gitignore?
Git Basics
10 questions · pass with 60% — just like in the app.
What is a Git "commit"?
git init only needs to be run once, the first time you start tracking a project.
The command ____ moves changed files into the staging area, ready to be committed.
What does git commit -m "message" do?
git status modifies or commits files when you run it.
The command ____ shows the full commit history, newest first.
What is a .gitignore file used for?
A file listed in .gitignore can still be committed if you run git add on it directly.
Files like .env, which contain secrets, should generally be listed in ____.
What does version control let multiple people do on the same project?
Keep your streak going in Swipe Coding
Swipe through every level of Ship It on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.
Get the Swipe apps →