What is GitLab?

GitLab is a web-based Git repository management tool with built-in DevOps and CI/CD (Continuous Integration/Continuous Delivery) features, offering an all-in-one platform for managing code and software development workflows.

Key Features of GitLab

  • Repositories: Store code, documentation, and version history in repositories, similar to GitHub.
  • Branches: Use branches to work on new features or fixes in isolation.
  • Merge Requests (MRs): Equivalent to GitHub’s Pull Requests, MRs are used to propose, review, and discuss changes before merging.
  • CI/CD Pipelines: Automate testing, building, and deployment with GitLab’s integrated CI/CD.
  • Issues: Track bugs, tasks, and enhancements within the repository.
  • Epics and Milestones: Organize projects by grouping issues into larger epics or milestones, useful for long-term planning.
  • Wiki: Built-in documentation for each project.
  • Time Tracking: Track time spent on issues or merge requests.
  • Security Scans: Perform static application security testing (SAST), dependency scanning, and more.

Basic GitLab Workflow

  1. Clone: Download the repository locally using git clone [URL].
  2. Create a Branch: Work on new features or bug fixes in separate branches with git checkout -b [branch-name].
  3. Commit Changes: Make changes, then use git add . and git commit -m "description" to save snapshots.
  4. Push Changes: Push commits to GitLab using git push origin [branch-name].
  5. Create a Merge Request: Open an MR in GitLab to review and merge changes into the main branch.
  6. Review & Merge: Collaborators review the MR, and once approved, merge it into the main branch.

Check out the GitLab Cheat Sheet