GitHub CLI Flashcards

1
Q

Q: What is GitHub CLI?

A

A: GitHub CLI (gh) is a command-line tool for interacting with GitHub repositories, issues, pull requests, and more.

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

Q: How do you install GitHub CLI?

A

A: Download it from cli.github.com or use a package manager like brew, apt, or choco.

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

Q: How do you authenticate with GitHub CLI?

A

A: Use gh auth login and follow the prompts to log in with a token or a web browser.

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

Q: How do you check if GitHub CLI is installed?

A

A: Run gh –version.

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

Q: How do you configure GitHub CLI?

A

A: Use gh config set <key> <value>, e.g., gh config set editor vim.</value></key>

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

Q: How do you clone a repository with GitHub CLI?

A

A: Use gh repo clone <repository>.</repository>

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

Q: How do you create a new repository with GitHub CLI?

A

A: Use gh repo create <name> and follow the prompts.</name>

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

Q: How do you view a repository’s details with GitHub CLI?

A

A: Use gh repo view.

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

Q: How do you fork a repository using GitHub CLI?

A

A: Use gh repo fork <repository>.</repository>

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

Q: How do you star a repository with GitHub CLI?

A

A: Use gh repo star <repository>.</repository>

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

Q: How do you list all repositories for a user or organisation?

A

A: Use gh repo list <username/org>.

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

Q: How do you create an issue using GitHub CLI?

A

A: Use gh issue create and follow the prompts.

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

Q: How do you list issues for a repository with GitHub CLI?

A

A: Use gh issue list.

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

Q: How do you view a specific issue’s details?

A

A: Use gh issue view <issue-number>.</issue-number>

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

Q: How do you close an issue using GitHub CLI?

A

A: Use gh issue close <issue-number>.</issue-number>

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

Q: How do you create a pull request using GitHub CLI?

A

A: Use gh pr create and follow the prompts.

17
Q

Q: How do you list pull requests in a repository?

A

A: Use gh pr list.

18
Q

Q: How do you view details of a specific pull request?

A

A: Use gh pr view <pr-number>.</pr-number>

19
Q

Q: How do you merge a pull request with GitHub CLI?

A

A: Use gh pr merge <pr-number>.</pr-number>

20
Q

Q: How do you check out a pull request locally?

A

A: Use gh pr checkout <pr-number>.</pr-number>

21
Q

Q: How do you search repositories using GitHub CLI?

A

A: Use gh repo list <query> with filters like --visibility or --language.</query>

22
Q

Q: How do you add a collaborator to a repository with GitHub CLI?

A

A: Use gh repo add-collaborator <username>.</username>

23
Q

Q: How do you create a release with GitHub CLI?

A

A: Use gh release create <tag> and follow the prompts.</tag>

24
Q

Q: How do you view logs or debug information for GitHub CLI commands?

A

A: Use gh <command></command> –verbose.

25
Q

Q: How do you check your authentication status with GitHub CLI?

A

A: Use gh auth status.