DEV Community

Johan G
Johan G

Posted on • Updated on

Git: Create a repo

Git Repository
A Git Repository, commonly referred to as a "Repo", is a container that tracks and manages files withing a folder.

Anytime we want to use git to track our project, we need to create a new git repository.

We can create as many repos as we want on our machine. Each repo has its own histories and contents.

Create a new Git Repo
To create a new git repository, execute the command below from the top-level folder containing the project
git init

Additional Notes

  1. Git tracks a directory and all nested subdirectories.
  2. Because of point #1, do not execute git init inside of an existing repo
    • Execute git status to verify that you are not inside of an existing repo.
      • If you get fatal: not a git repository or any of the parent directories: .git, then you're not inside of an existing repo.

Top comments (0)