Module 9: Introduction to Git

Lesson 2 of 5 ยท 15โ€“25 minutes

Repositories

๐Ÿ The everyday picture

A project folder with a very careful librarian living inside it, writing down every change.

๐Ÿ“˜What it really is

๐Ÿ–ฑ๏ธTry it

In VS Code's terminal, inside my-first-site:

git init
git status

Git reports that index.html is untracked: it exists, but Git isn't recording it yet. Now create a file called .gitignore containing the single line .env.

โœ…Quick check

What's inside the hidden .git folder?

Show the answer

The repository's entire history. Deleting it removes the history, not your current files.

Why add .env to .gitignore?

Show the answer

So secret values in .env are never recorded by Git or uploaded to GitHub.

โ† PreviousWhy version control exists
ProLearners Assist