Git – How to create a local repository

In this post, we will see how to create a local repository using Git.

We open Git Bash, go into directory where we want to create a local repository and we run these commands:
git init
git add –all
git commit -m”put a comment”

The local repository has been now created!

If the second command has generated a permission error like this:

verify we have inserted in the directory a .gitignore file.
For a .NET project, it’s a file with only this row:
.vs/