Swipe
SwipeSwipe
Swipe Apps

Paths

Motivation

Information

Git Basics · Lesson 6 of 6

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 is the command you'll run more than any other — it's always safe, and always useful. 🔍

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 status reports what changed, without modifying anything — always safe to run.

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 form
git log lists commits from newest to oldest, each with its message.
True or false

Running 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 typical .gitignore: one pattern per line — here, a dependency folder, a secrets file, and any .log file.
Fill in the blank

A file named ____ lists file and folder patterns that Git should never track or stage.

Quick check

Why should a file containing API keys or passwords typically be listed in .gitignore?

Chapter quiz

Git Basics

10 questions · pass with 60% — just like in the app.

Quick check

What is a Git "commit"?

True or false

git init only needs to be run once, the first time you start tracking a project.

Fill in the blank

The command ____ moves changed files into the staging area, ready to be committed.

Quick check

What does git commit -m "message" do?

True or false

git status modifies or commits files when you run it.

Fill in the blank

The command ____ shows the full commit history, newest first.

Quick check

What is a .gitignore file used for?

True or false

A file listed in .gitignore can still be committed if you run git add on it directly.

Fill in the blank

Files like .env, which contain secrets, should generally be listed in ____.

Quick check

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 →