Thuta Learning
Git
BasicDevOps & ToolsBeginner

git init

GitLesson 5

git init is the command used to create a brand-new Git repository. You can run it inside a new project folder or an existing one. It creates a hidden .git subfolder, and that's where Git stores all the data it needs.

bash
# 1. Create a new directory and navigate into it
mkdir my-project
cd my-project

# 2. Initialize a new Git repository
git init
You should see
Initialized empty Git repository in /path/to/my-project/.git/

Updated on

Progress is saved only in this browser on this device. It isn't synced to other devices.

Report a problem with this lessonOpens your email app with this lesson's address filled in — nothing is sent until you send it.

git init | Thuta Learning