June 15, 2026 · by Meegrow Labs

What Does git init Do? Start Tracking Your Code

You have a project folder. Maybe it is a college assignment. Maybe it is your first web app. Right now it is just a pile of files sitting on your disk, and nothing is keeping a history of your changes.

To fix that, you flip one switch with a single short command. Let’s see exactly what that command does.

The git init command turns an ordinary folder into a Git project, telling Git to start tracking every file inside it from that moment on.

What does git init actually do?

Think of a switchboard. On one side is your plain folder, just files on a disk. You press one switch, and Git lights up. The folder is now tracked.

Before you run the command, Git is not watching your project at all. After you run it, Git is awake and ready to record every version of your work, quietly, in the background.

To make this happen, you open a terminal inside your project folder and type:

git init

That is the whole command. Two short words, and your folder becomes a place where history is saved.

What do the two parts of the command mean?

The command has two parts, and each one is simple once you break it down.

  • git is the tool you are calling, the program that handles version control.
  • init is short for initialise, which just means “start here”.

So git init reads almost like plain English: “Git, start here, in this folder.” It always runs in whichever folder your terminal is currently sitting in, so make sure you are inside the right project first.

If terminals are still new to you, it helps to first understand what a terminal is and how to move into folders before you run this. You can pick that up step by step in the free Zero to AI Hero course.

What happens inside the folder after git init?

When you run the command, Git creates a hidden helper: a folder named .git (read as “dot git”). This is where Git quietly stores every version of your project.

You usually will not open or touch this folder. It is Git’s private notebook. Each time you save a checkpoint later, the record goes in here. If you ever delete this hidden folder, Git stops tracking the project, so leave it alone.

You can check that it worked by listing the hidden files in your folder. On most systems, running ls -a will show .git in the list.

How often do I run git init?

You only run git init once per project. Do it when a project is brand new and you want Git to start watching it. After that first flip of the switch, Git keeps tracking the folder for the life of the project.

You do not run it again every day, and you do not run it for files inside an already-tracked folder. One project, one git init. If you start a second, separate project later, that one gets its own git init.

How do I try git init right now?

The best way to learn this is to do it. Try these steps on your own machine:

  • Open your terminal.
  • Move into a project folder (or make a new empty one to practise).
  • Type git init and press Enter.

Git will print a short message confirming it has started an empty repository in your folder. That is it. Your folder is now tracked, and you are ready for the next step: choosing which changes to save.

Key takeaways

  • git init turns an ordinary folder into a Git-tracked project.
  • The command has two parts: git (the tool) and init (start here).
  • It creates a hidden .git folder that stores every version of your work.
  • You run it only once per project, when the project is new.
  • Test it by typing git init in your project folder, then check for .git with ls -a.

Once Git is awake, the next move is deciding which changes you want it to record. You can keep going lesson by lesson in the free Zero to AI Hero course and go from scared to confident with Git.


🚀 Take the full free course: Zero to AI Hero — learn to build with AI from scratch. New lessons daily, in Hindi & English.

Meegrow Labs

We help India go from zero to AI hero — learn to use & build with AI from scratch, in Hindi & English. Start the free course →

Want to actually learn this?

151 free 2-minute lessons — from "what's a file?" to building with AI.

▶ Start the free course