How to create a new local repository?

git init

To create a new git repository in your current directory use git init.

Git won't work if your current directory or any of the parent directores doesn't have the .git directory.

Layer 1
Terminal Example
git status
fatal: not a git repository (or any of the parent directories): .git

git init
Initialized empty Git repository in /Users/githint/Projects/new_repo/.git/

See git init to learn more about it.

Last modified on November 30, 2021.

You might also like