To create a repository, you need to create a directory for the project if it does not already exist, and then simply execute the command “git init”. By executing this command, a .git directory will be created inside the project directory i.e. now your project directory has turned into a Git repository.