Presented by Krishna Prasad

About Us

What is our aim

Git Init ( git init ) Command

git init command helps us to initialize a repository to version control repository i.e a git repository.

git init will initialize the present directory into version control system (VCS) repository and add a configuration directory .git into the present directory and makes it to start recording versions of the project.

$pwd
/Users/krishna/Documents/commands-test

Let's check whether the above directory [commands-test] is a git repository or not by the git command git status or by checking whether there is configuration directory .git present in current directory or not.

$git status
fatal: Not a git repository (or any of the parent directories): .git

$ls -a
. ..

So, it is clearly visible that it is not a git repository. let's make it by git init command.

$git init
Initialized empty Git repository in /Users/krishna/Documents/commands-test/.git/

The commands used for the above discussion

git init commands

Now we created a git repository, let's play with other git commands like git status, git config