How to create a new Git repository locally?

To create a new Git repository locally, you can follow these steps:

  1. Open your terminal or command prompt.
  2. Navigate to the directory where you want to create the new Git repository. For example, using the cd command:
cd /path/to/new/repository
  1. Initialize a new Git repository in that directory using the git init command:
git init
  1. Your new Git repository is now created. You can start adding files to it, commit changes, and perform other Git operations.

Note: If you already have an existing Git repository locally and want to create a new repository, make sure to move to a different directory where you want to create the new repository.