Cloning your repository and pushing code to it
In this recipe, we will take a look at cloning your repository from GitLab to your local machine. When you use Git Bash on Windows, the commands will be the same.
Getting ready
You need to create a new repository in your GitLab instance. In this example, we will use the repository named super-git
.
How to do it…
In the following steps, we will set up our repository and push code to it:
- Go to the newly created repository.
- Select the URL in the top-right section.
- Go to the folder where you want to check out the project in the terminal. No need to create a new folder for the project.
- Enter the Git
clone
command, and change the URL to the URL you just copied:$ git clone URL
In my case, the URL is as follows:
$ git clone git@146.185.139.107:jeroen/super-git.git
The following screenshot shows you the output of this command:
- You can now go to the folder and check whether it is a Git folder by running the following command:
$ git status
The following screenshot...