Initializing a repository

In order to start working with Git, the first thing we need to do is creating a directory for our project (a folder in your computer). You can put this directory anywhere on your computer. To do so, open Git Bash and run:

mkdir directory_name
Now to move into the directory use
cd directory_name
You can combine these two actions in one with &&. So mkdir and cd become
mkdir directory_name && cd directory_name

Now that we have a directory, we need to initialize a new empty repository. To do this, we run

git init

You should see a message that says that an empty repository was initialized and the path to the directory. Inside your directory, you now have a sub-directory called .git. This subdirectory is hidden because you are not supposed to touch it. If you list all the files in your directory with

ls

you won't see the .git sub-directory. To list it, use

ls -a

you can now see it (the -a flag stands for all). You can open this sub-directory with

start .git

If you corrupt or remove this directory, you will lose your project's history. If you need to remove it, just run

rm -rf .git