Initialize a local Git repository

Last updated 3 years, 7 months ago | 1379 views 75     5

Tags:- Git

Git init | Initialize a local Git repository

The git init command creates a new Git repository in local. This is usually the first command you will run before working on a new project.

git init

# Output
Initialized empty Git repository in D:/git_new_repo/.git/

It creates a ".git" subdirectory in the current working directory. The subdirectory contains all the necessary Git metadata for the new repository.

.
│   config
│   description
│   HEAD
│
├───hooks
│       applypatch-msg.sample
│       commit-msg.sample
│       fsmonitor-watchman.sample
│       post-update.sample
│       pre-applypatch.sample
│       pre-commit.sample
│       pre-merge-commit.sample
│       pre-push.sample
│       pre-rebase.sample
│       pre-receive.sample
│       prepare-commit-msg.sample
│       update.sample
│
├───info
│       exclude
│
├───objects
│   ├───info
│   └───pack
└───refs
    ├───heads
    └───tags