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
The commands used for the above discussion