GitLab CLI Flashcards
What is the GitLab CLI?
The GitLab CLI, also known as lab, is a command-line tool for interacting with GitLab repositories, issues, merge requests, and other GitLab features from the terminal.
How do you install the GitLab CLI?
The GitLab CLI can be installed using package managers like Homebrew (macOS), Scoop or Chocolatey (Windows), or by downloading the binary from the GitLab CLI releases page.
How do you authenticate with the GitLab CLI?
To authenticate with the GitLab CLI, you need to create a personal access token in your GitLab account settings and configure the CLI to use it by running gitlab config set private_token .
How do you clone a GitLab repository using the CLI?
To clone a GitLab repository using the CLI, use the command: lab repo clone <namespace/project>
How do you create a new issue using the GitLab CLI?
To create a new issue using the GitLab CLI, use the command: lab issue create –title “Issue title” –description “Issue description”
How do you list issues for a GitLab project using the CLI?
To list issues for a GitLab project using the CLI, use the command:
lab issue list <namespace/project>
How do you create a new merge request using the GitLab CLI?
To create a new merge request using the GitLab CLI, use the command: lab mr create –source <source_branch> --target <target_branch> --title ""MR title"" --description ""MR description"" <namespace/project></target_branch></source_branch>
How do you list merge requests for a GitLab project using the CLI?
To list merge requests for a GitLab project using the CLI, use the command: lab mr list .
How do you check the status of a GitLab CI/CD pipeline using the CLI?
To check the status of a GitLab CI/CD pipeline using the CLI, use the command: lab pipeline status –ref .
How do you view the logs of a specific GitLab CI/CD job using the CLI?
To view the logs of a specific GitLab CI/CD job using the CLI, use the command: lab job logs –job-id .
How do you create a new snippet using the GitLab CLI?
To create a new snippet using the GitLab CLI, use the command: lab snippet create –title ““Snippet title”” –file <path_to_file></path_to_file>
How do you list snippets for a GitLab project using the CLI?
To list snippets for a GitLab project using the CLI, use the command: lab snippet list <namespace/project>
How do you create a new release using the GitLab CLI?
To create a new release using the GitLab CLI, use the command: lab release create –name ““Release name”” –tag-name <tag_name> --description ""Release description"" <namespace/project></tag_name>
How do you list releases for a GitLab project using the CLI?
To list releases for a GitLab project using the CLI, use the command: lab release list .
How do you update your GitLab CLI to the latest version?
To update your GitLab CLI to the latest version, use the command: lab update.