There are two types of Git repositories: remote and local.
A remote repository is hosted on a remote, or off-site, server that is shared among multiple team members.
A local repository is hosted on a local machine for an individual user.
While you can take advantage of Git version control features with a local repository, collaboration features—like pulling and pushing code changes with teammates—will be better suited on a remote repository.
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.
You can create a new repo from scratch using the git init command. It can be used to introduce Git into an existing, unversioned project in order to start tracking changes.
Use the git clone command to copy a remote repository onto your local machine.
By default, git clone automatically sets up a local master branch that tracks the remote master branch it was cloned from.
A cloned repository has the same history log as the original one. You can refer and backtrack to any of those commits within your local repository.