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 initYou should see
Initialized empty Git repository in /path/to/my-project/.git/