Sobes.tech
Intern

How to create a local Git repository?

sobes.tech AI

Answer from AI

  1. Open the terminal or command prompt.
  2. Navigate to the directory you want to make a repository, or create a new one.
    # Navigate to an existing directory
    cd /path/to/folder
    
    # Or create a new directory and navigate into it
    mkdir new_repository
    cd new_repository
    
  3. Initialize a Git repository in the current directory.
    # Initialize an empty Git repository
    git init
    

A hidden folder .git will appear in the directory, containing the necessary files for Git operation.