Starting a Repo & Identity

Creating a Repository

Turn any folder into a Git repo with one command:

$ git init
Initialized empty Git repository in /home/labuser/project/.git/

This creates a hidden .git/ directory - the entire history lives there. Delete it and the folder becomes an ordinary directory again.

Before your first commit, tell Git who you are (it stamps every commit with this):

$ git config --global user.name  "Your Name"
$ git config --global user.email "you@example.com"
CommandPurpose
git initStart tracking the current folder
git config --global user.nameSet your commit name
git config --listShow current config
git clone <url>Copy an existing remote repo
Tip: --global sets it for every repo on your machine. Drop --global to override it for just one project (handy for work vs personal emails).

Try it below: git init a folder, then set a name and email.