Skip to main content

GitHub CLI

GitHub Logo

GitHub CLI brings GitHub to your terminal. Free and open source. Official website: https://cli.github.com

GitHub CLI is official released on September 17, 2020.

GitHub CLI Manual

PS F:\Projects\github> winget upgrade gh
Found GitHub CLI [GitHub.cli]
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/cli/cli/releases/download/v2.0.0/gh_2.0.0_windows_amd64.msi
  ██████████████████████████████  6.97 MB / 6.97 MB
Successfully verified installer hash
Starting package install...
Successfully installed
PS F:\Projects\github>
gh -h
gh auth login
gh repo view
gh repo list
gh repo rename new-name-here
PS F:\Projects\github\lthwgh> gh --help
Work seamlessly with GitHub from the command line.

USAGE
  gh <command> <subcommand> [flags]

CORE COMMANDS
  browse:     Open the repository in the browser
  gist:       Manage gists
  issue:      Manage issues
  pr:         Manage pull requests
  release:    Manage GitHub releases
  repo:       Create, clone, fork, and view repositories

ACTIONS COMMANDS
  actions:    Learn about working with GitHub actions
  run:        View details about workflow runs
  workflow:   View details about GitHub Actions workflows

ADDITIONAL COMMANDS
  alias:      Create command shortcuts
  api:        Make an authenticated GitHub API request
  auth:       Login, logout, and refresh your authentication
  completion: Generate shell completion scripts
  config:     Manage configuration for gh
  help:       Help about any command
  secret:     Manage GitHub secrets
  ssh-key:    Manage SSH keys

FLAGS
  --help      Show help for command
  --version   Show gh version

EXAMPLES
  $ gh issue create
  $ gh repo clone cli/cli
  $ gh pr checkout 321

ENVIRONMENT VARIABLES
  See 'gh help environment' for the list of supported environment variables.

LEARN MORE
  Use 'gh <command> <subcommand> --help' for more information about a command.
  Read the manual at https://cli.github.com/manual

FEEDBACK
  Open an issue using 'gh issue create -R github.com/cli/cli'

PS F:\Projects\github\lthwgh>
PS F:\Projects\github> gh repo create lthwgh
Welcome to GitHub CLI!

To authenticate, please run `gh auth login`.
PS F:\Projects\github> gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser

! First copy your one-time code: 0BBC-F1C8
- Press Enter to open github.com in your browser...
✓ Authentication complete. Press Enter to continue...

- gh config set -h github.com git_protocol https
✓ Configured git protocol
✓ Logged in as tuyendq
PS F:\Projects\github> gh repo create lthwgh
? Visibility Public
? Would you like to add a .gitignore? No
? Would you like to add a license? No
? This will create the "lthwgh" repository on GitHub. Continue? Yes
? Create a local project directory for "tuyendq/lthwgh"? Yes
Initialized empty Git repository in F:/Projects/github/lthwgh/.git/
✓ Initialized repository in "lthwgh"
PS F:\Projects\github> cd lthwgh

PS F:\Projects\github\lthwgh> git status
On branch main

No commits yet

nothing to commit (create/copy files and use "git add" to track)
PS F:\Projects\github\lthwgh> git remote -v
origin  https://github.com/tuyendq/lthwgh.git (fetch)
origin  https://github.com/tuyendq/lthwgh.git (push)
PS F:\Projects\github\lthwgh>

Popular posts from this blog

Java: Free Online Courses

The Java™ Tutorials by Oracle The Java Tutorials are practical guides for programmers who want to use the Java programming language to create applications. They include hundreds of complete, working examples, and dozens of lessons. Groups of related lessons are organized into "trails". https://docs.oracle.com/javase/tutorial/ Learn to Program in Java at edX.ogr Get started on the path to becoming a software engineer by learning core coding skills in Java—one of the most popular programming languages. https://www.edx.org/course/learn-to-program-in-java-0 Java Tutorial by javapoint.com https://www.javatpoint.com/java-tutorial Java Tutorial by SoloLearn.com I love SoloLearn because I can learn Java - and other popular programming languages - anywhere, any time on your mobile devices. https://www.sololearn.com/Course/Java/ Java on Azure https://docs.microsoft.com/en-us/learn/paths/java-on-azure/

Less secure app access in gmail or G Suite

From G Suite Update on December 16, 2019 Google turned off less secure app access to G Suite accounts .