Creating repositories
There are two ways to create a local repository on your machine: you can create a new repository from scratch using a file folder on your computer or clone an existing repository.
New repositories
You can create a new repo from scratch using the git init command. It can introduce Git into an existing, unversioned project so that you can start tracking changes.
Copied repositories
You can copy a remote repository onto your local machine using the git clone command. By default, git clone will automatically set up a local main branch that tracks the remote main branch it was cloned from.
A cloned repository has the same history log as the original one. You can refer and backtrack to any commits within your local repository.