GitHub CLI Flashcards
Q: What is GitHub CLI?
A: GitHub CLI (gh) is a command-line tool for interacting with GitHub repositories, issues, pull requests, and more.
Q: How do you install GitHub CLI?
A: Download it from cli.github.com or use a package manager like brew, apt, or choco.
Q: How do you authenticate with GitHub CLI?
A: Use gh auth login and follow the prompts to log in with a token or a web browser.
Q: How do you check if GitHub CLI is installed?
A: Run gh –version.
Q: How do you configure GitHub CLI?
A: Use gh config set <key> <value>, e.g., gh config set editor vim.</value></key>
Q: How do you clone a repository with GitHub CLI?
A: Use gh repo clone <repository>.</repository>
Q: How do you create a new repository with GitHub CLI?
A: Use gh repo create <name> and follow the prompts.</name>
Q: How do you view a repository’s details with GitHub CLI?
A: Use gh repo view.
Q: How do you fork a repository using GitHub CLI?
A: Use gh repo fork <repository>.</repository>
Q: How do you star a repository with GitHub CLI?
A: Use gh repo star <repository>.</repository>
Q: How do you list all repositories for a user or organisation?
A: Use gh repo list <username/org>.
Q: How do you create an issue using GitHub CLI?
A: Use gh issue create and follow the prompts.
Q: How do you list issues for a repository with GitHub CLI?
A: Use gh issue list.
Q: How do you view a specific issue’s details?
A: Use gh issue view <issue-number>.</issue-number>
Q: How do you close an issue using GitHub CLI?
A: Use gh issue close <issue-number>.</issue-number>