DEV Community

Mahalakshmi C
Mahalakshmi C

Posted on

What is GitLab? How to Install, Use, and Push Code .

Hii Guys

In this blog, we are going to see how to install GitLab and Works.

What is GitLab?

GitLab is a web-based DevOps platform that provides:

  • Git repository hosting
  • Continuous Integration / Continuous Deployment (CI/CD)
  • Issue tracking
  • Project management tools

👉 GitLab Official website:(https://gitlab.com?utm_source=chatgpt.com)

👉 GitLab Official Download:(https://gitscm.com/downloads?utm_source=chatgpt.com)

How to Create a GitLab Account

  1. Create GitLab Account
  2. Sign up using email
  3. Verify your account

How GitLab Works

  1. Create a repository (project)
  2. Clone it to your local system
  3. Make changes
  4. Commit changes
  5. Push to GitLab

Basic Git Commands

  1. Initialize Git Repository

git init
Creates a new Git repository in your folder

2.Check Status

git status
Shows changed, staged, and untracked files.

3.Add Files

git add file_name
Adds a specific file .

git add .
Adds all files.

4.Commit Changes

git commit -m "Your message"
Saves changes with a message.

5.Connect to GitLab Repository

git remote add origin https://gitlab.com/username/project.git
Links your local project to GitLab.

6.Push Code

git push -u origin main

  • "origin" → remote name
  • "main" → branch name
  • "-u" → sets upstream (first time only)

7.Clone Repository

git clone https://gitlab.com/username/project.git
Downloads project from GitLab.

8.Pull Latest Changes

git pull
Gets latest updates from GitLab.

Top comments (0)