What is Git? Init and status

What version control and a repository are.

1. What is this?

Version control records snapshots of your files so you can rewind. A repository (repo) is a folder Git watches. git init turns the current folder into a repo. git status reports what changed: which files are new, modified, or safely saved.

2. Why do we use it?

Without snapshots, one bad edit can lose a day. With Git, every step is recoverable and reviewable.

3. Syntax breakdown

  • git init

    Creates the hidden .git folder that stores history. Run once per project.

  • git status

    Shows the state: untracked, modified, or staged files.

5. Common mistakes

  • Running git init inside an existing repo, nesting histories.
  • Ignoring git status output — always read it before committing.
  • Committing secrets (.env, passwords) — use .gitignore.

Practice task

Run git status again after imagining you created notes.txt. (Type the two commands.)

Hint

git init then git status, one per line.

Try it below — tests run automatically when you press Run.

git

Output

Press Run to see output.

Mini quiz

3 questions. Answer, then check.

  1. 1. What is a repository?

  2. 2. What does git status show?

  3. 3. How often do you run git init per project?

4. Example — edit and run

git

Output

Press Run to see output.

Expected output: Initialized empty Git repository.