Book Image

GitLab Cookbook

By : Jeroen van Baarsen
Book Image

GitLab Cookbook

By: Jeroen van Baarsen

Overview of this book

Table of Contents (16 chapters)
GitLab Cookbook
About the Author
About the Reviewers

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:

  1. Open your terminal and browse to the folder where you want to create your project.

  2. Create a folder named super-git and create the following directory inside it:

    $ mkdir super-git
    $ cd super-git
  3. 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:

  4. Let's create one file to add to the repository. We name it

    $ echo "HELLO README" >	
  5. Now, we will add this new file to Git. This is also known as staging the files:

    $ git add
  6. Commit the file...