Creating your first Git project
In this recipe, we will take a look at creating your first Git project on your local machine. If you're a Windows user, please make sure that you use Git Bash. This way, you can use the same commands as the ones Linux and OS X users use.
We're going to create a project called super-git
.
How to do it…
To create our first Git project, perform the following steps:
- Open your terminal and browse to the folder where you want to create your project.
- Create a folder named
super-git
and create the following directory inside it:$ mkdir super-git $ cd super-git
- To make this folder a Git project, we need to tell Git to monitor this folder. We do this by typing the following command:
$ git init
The following screenshot shows you the output for this command:
- Let's create one file to add to the repository. We name it
README.md
:$ echo "HELLO README" > README.md
- Now, we will add this new file to Git. This is also known as staging the files:
$ git...