What Git is
Git is a program that remembers the history of changes in your project. Each “version” is called a commit (a save). Broke your code? Go back to an older commit. Professional developers never work without Git.
Install Git and run the first commands with a parent. On a Mac, it’s often already there (git --version). On Windows, download Git for Windows.
Show me: your first repository
Open a terminal in your React or server project folder:
git init
This tells Git: “start tracking changes here.” A hidden folder .git is created.
Add all files to your first commit:
git add .
git commit -m "First version of my website"
git add .= prepare all changed filesgit commit -m "..."= save a snapshot with a description
Take a look at the history:
git log --oneline
You’ll see something like a1b2c3d First version of my website.
Show me: .gitignore
node_modules should never go into your project – it’s huge and gets downloaded via npm install. Create a file called .gitignore:
node_modules/
dist/
.env
*.db
.DS_Store
Then commit again:
git add .
git commit -m "Added gitignore"
Your turn 💪
- In the root of your project (React or server), run
git init. - Create a
.gitignorefollowing the example above. - Make two commits: one “First version”, another after a small change (e.g. edit the text in your footer).
git log --oneline– can you see both?
Check: You have a repository, a .gitignore, and at least 2 commits. Git only lives on your computer so far – in the next lesson we’ll push it to GitHub.
What to take away from this lesson
git initstarts tracking a folder.- A commit = a saved version with a description.
.gitignoretells Git what not to save.
© 2026 Ing. Martin Polak / AlgoRhino · Content usage terms