WEEK 7 · LESSON 2 · TOPIC 3 OF 10 · Repository Creation by Initialization

Repository Creation by Initialization

Lesson progress

0% Complete

SECTION 1 OF 1

In this topic · 1 sections
  1. Overview

Overview

To begin tracking an existing local project folder, open a terminal in that folder and run:

git init

This initializes an empty Git repository inside the current directory. Git creates a hidden directory named .git. That hidden directory contains Git's internal repository data, including information used to track changes, commits, and history.

The project folder remains the working directory. The .git directory is what makes that folder a Git repository.

You can verify that the hidden directory exists with a command that displays hidden files, such as:

ls -la

The .git directory is managed by Git. It is the internal core of the repository rather than an ordinary project folder for manual editing.