GitLab CLI Flashcards

1
Q

What is the GitLab CLI?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you install the GitLab CLI?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you authenticate with the GitLab CLI?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you clone a GitLab repository using the CLI?

A

To clone a GitLab repository using the CLI, use the command: lab repo clone <namespace/project>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you create a new issue using the GitLab CLI?

A

To create a new issue using the GitLab CLI, use the command: lab issue create –title “Issue title” –description “Issue description”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you list issues for a GitLab project using the CLI?

A

To list issues for a GitLab project using the CLI, use the command:
lab issue list <namespace/project>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you create a new merge request using the GitLab CLI?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you list merge requests for a GitLab project using the CLI?

A

To list merge requests for a GitLab project using the CLI, use the command: lab mr list .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you check the status of a GitLab CI/CD pipeline using the CLI?

A

To check the status of a GitLab CI/CD pipeline using the CLI, use the command: lab pipeline status –ref .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you view the logs of a specific GitLab CI/CD job using the CLI?

A

To view the logs of a specific GitLab CI/CD job using the CLI, use the command: lab job logs –job-id .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you create a new snippet using the GitLab CLI?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you list snippets for a GitLab project using the CLI?

A

To list snippets for a GitLab project using the CLI, use the command: lab snippet list <namespace/project>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you create a new release using the GitLab CLI?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you list releases for a GitLab project using the CLI?

A

To list releases for a GitLab project using the CLI, use the command: lab release list .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you update your GitLab CLI to the latest version?

A

To update your GitLab CLI to the latest version, use the command: lab update.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you get help or view the documentation for a specific GitLab CLI command?

A

To get help or view the documentation for a specific GitLab CLI command, use the –help flag after the command, e.g., lab issue create –help.

17
Q

How do you configure the GitLab CLI to use a custom GitLab instance URL?

A

To configure the GitLab CLI to use a custom GitLab instance URL, use the command: gitlab config set host .

18
Q

How do you view your current GitLab CLI configuration?

A

To view your current GitLab CLI configuration, use the command: gitlab config get.

19
Q

How do you create a new GitLab project using the CLI?

A

To create a new GitLab project using the CLI, use the command: lab project create –name ““Project name”” –description ““Project description””

20
Q

How do you list all GitLab projects you have access to using the CLI?

A

To list all GitLab projects you have access to using the CLI, use the command: lab project list.