GitLab Tutorials

HOME

GitLab is the open DevOps platform, delivered as a single application. This makes GitLab unique and creates a streamlined software workflow, unlocking your organization from the constraints of a pieced together toolchain. Learn how GitLab offers unmatched visibility and higher levels of efficiency in a single application across the DevOps lifecycle.

Chapter 1 How to create a new project in GitLab
Chapter 2 How to Export Eclipse projects to GitLab
Chapter 3 How to Export IntelliJ project to GitLab
Chapter 4 How to Clone a project from GitLab using Eclipse
Chapter 5 How to Clone a project from GitLab using IntelliJ

How to create a new project in GitLab

HOME

In this tutorial, I will explain how we can create a new empty project in GitLab.

Implementation Steps

Step 1 – Login to GitLab using your username and password.

Step 2 – In your dashboard, click the blue New project button. This opens the New project page.

Step 3 – The New project page provides 4 options to select:

  1. Create a blank project.
  2. Create a project using one of the available project templates.
  3. Import a project from a different repository, if enabled on your GitLab instance.
  4. Run CI/CD pipelines for external repositories. 

As I have mentioned earlier, I want to create a new empty project, so I will select open 1 (Create a blank project).

Step 4 – A new page will open .Provide the following information in that page:

  1. Project Name – Mention the name of your project in the Project name field – CucumberGradleDemo. You can’t use special characters, but you can use spaces, hyphens, underscores, or even emoji.

2. Project slug – When a name is added, the Project slug auto populates. The path to your project in the Project slug field. This is the URL path for your project that the GitLab instance uses. If the Project name is blank, it auto populates when you fill in the Project slug. If you want a different slug, input the project name first, then change the slug after.

3. Project description (optional)  – This field enables you to enter a description for your project’s dashboard, which helps others understand what your project is about. Though it’s not required, it’s a good idea to fill this in.

4. Visibility Level – Select the appropriate Visibility Level for your project.

5. Selecting the Initialize repository with a README option creates a README file so that the Git repository is initialized, has a default branch, and can be cloned.

Select the Create Project button.

Congratulations!!. We have just created a new and empty project in GitLab. Now you can clone this project and start working on it.

How to Export IntelliJ project to GitLab

HOME

What is GitLab?

GitLab is the open DevOps platform, delivered as a single application that spans the entire software development lifecycle. If you’re not using GitLab, your DevOps lifecycle is likely spread across any number of applications. These silos take overhead to integrate, manage, configure, and maintain, slowing down your team and your deployments. Moving to a single application will speed up your workflow and help you deliver better software, faster. To know more about GitLab, click here.

In this article, we will see how to push an existing project to GitLab using Eclipse IDE.

Implementation Steps

Step 1 – Go to Git at the top, select VCS ->VCS Oprations -> Create Git Repository

This will convert the project to Git project.

Step 2 – Go to Git. Select “Commit”.

Step 3 – This will show all the files which are uncommitted. Select the files you want to commit and mention a message in the below message box as “New project from IntelliJ to GitLab”. Click on the Commit Button.

Step 4 – A window will open where we need to mention the location where project should be pushed in GitLab. Click the OK button. It will ask for credentials to the GitLab , provide them.

Step 5 – The below image shows that latest code is moved to GitLab. Here, the origin branch is used to commit and pushed the changes. If we are using a local branch to commit and push the changes, then we need to create a merge request to merge the code of new branch to the code of existing origin(master branch).

Congratulations on making it through this tutorial and hope you found it useful! Happy Learning!! Cheers!!

How to Export Eclipse projects to GitLab

HOME

What is GitLab?

GitLab is the open DevOps platform, delivered as a single application that spans the entire software development lifecycle. If you’re not using GitLab, your DevOps lifecycle is likely spread across any number of applications. These silos take overhead to integrate, manage, configure, and maintain, slowing down your team and your deployments. Moving to a single application will speed up your workflow and help you deliver better software, faster. To know more about GitLab, click here.

In this article, we will see how to push an existing project to GitLab using Eclipse IDE.

Implementation Steps

Step 1 – Go to GitLab and select the project which you want to clone. Click on the blue color “Clone” button then copy the hyperlink as shown in the image. You can either Clone with SSH or Clone with HTTPS.

Step 2 – Open Eclipse IDE and right-click on the project you want to push and go to the Team ->Share project.

Step 3 – It will add the project to the given repository as shown in below image. Select the Finish button.

Step 4 – Again right-click on the project and go to the Team ->commit.

Step 5 – Select the files you want to commit and click green color + sign or Drag and Drop the files from Unstaged Changes to Staged Changes.

This is how the stage files looked like as shown below.

Step 6 – Write the commit message in “Commit Message” and click “Commit and Push“.

Step 7 – Fill in the below details in this window and click the “Preview” button.

URI – This is the URL that we have cloned from GitLab in Step 1.
Host – gitlab.com
Repository path – path of project in gitlab (This is auto populated after entring URI)

Autehntication
User – Username of GitLab
Password – password of GitLab

Step 8 – A new window will open which provides the detail of Destination location of the project. Click the “Preview” button.

Step 9 – Push to the new-branch of GitHub Repository and click the “Push“ button.

Step 10 – As this is a new project with a master branch, you can see the whole project migrated in GitLab. If we are not using the master branch, but the local branch, then we need to create a merge request to merge the latest changes in the already existing project in GitLab.

Cheers!!Congratulations on making it through this tutorial and hope you found it useful! Happy Learning!!

How to Clone a project from GitLab using IntelliJ

HOME

What is GitLab?

GitLab is a web-based Git repository that provides free open and private repositories, issue-following capabilities, and wikis. It is a complete DevOps platform that enables professionals to perform all the tasks in a project—from project planning and source code management to monitoring and security.

In this tutorial, I will explain how we can clone a project from GitLab in IntelliJ.

Implementation Steps

Step 1 – Go to GitLab and select the project which you want to clone. Click on the blue color “Clone” button then copy the hyperlink as shown in the image. You can either Clone with SSH or Clone with HTTPS.

Step 2 – From the main menu, select Git -> Clone

Another way is File ->New -> Project from Version Control

Step 3 – In the Get from Version Control dialog, specify the URL of the remote repository you want to clone. This is retrieved from Step 1 . Click the Clone button.

Step 4 – A dialog box will appear to login to the GitLab. Provide the username and password of GitLab. Select the “Log In” button.

Step 5 – When you import or clone a project for the first time, IntelliJ IDEA analyzes it. If the IDE detects more than one configuration (for example, Eclipse and Gradle), it prompts you to select which configuration you want to use. Select the necessary configuration and click the OK button. I have selected Maven project.

Step 6 – Once I have selected the Maven project, a new dialog box will appear. IntelliJ asks you to either Trust Project or Preview in Safe Mode. I Trust the project, so I have selected the Trust Project button.

Step 7 – IntelliJ will ask if you want to open the project in current window or New Window. It is always a good practice to open the project in New Window.

Step 8 – We have successfully imported the GitLab Repository as shown in the below image.

Congratulations on making it through this tutorial and hope you found it useful! Happy Learning!! Cheers!!

How to Clone a project from GitLab using Eclipse

HOME

What is GitLab?

GitLab is a web-based Git repository that provides free open and private repositories, issue-following capabilities, and wikis. It is a complete DevOps platform that enables professionals to perform all the tasks in a project—from project planning and source code management to monitoring and security.

In this tutorial, I will explain how we can clone a project from GitLab in Eclipse.

Implementation Steps

Step 1 – Go to GitLab and select the project which you want to clone. Click on the blue color “Clone” button then copy the hyperlink as shown in the image. You can either Clone with SSH or Clone with HTTPS.

Step 2 – Open Eclipse and go to File > Import in eclipse as shown in the image.

Step 3 – A window will pop up in which select Git Folder. Under Git folder, select option – Projects from Git(with smart import) as shown in the image. Click the NEXT button.

Step 4 – A new window will pop up in which select option – Clone URI as shown in the image. Click on the NEXT button.

Step 5 – Another window will pop up in which you have to paste the GitLab Repository URL and also  GitLab UserID and Password and click on the “Next” button.

URI – This is the URL that we have cloned from GitLab in Step 1.
Host – gitlab.com
Repository path – path of project in gitlab (This is auto populated after entring URI)

Autehntication
User – Username of GitLab
Password – passowrd of GitLab

Step 6 – Select master and select “When fetching a commit, also fetch its tags”. Click the “Next” button.

Step 7 –  Select the Folder directory in which you want to import the repository and click the “Finish“ button.

Step 8 – We have successfully imported the GitLab Repository as shown in the below image.

Congratulations on making it through this tutorial and hope you found it useful! Happy Learning!! Cheers!!