Quantcast
Channel: Scott Hanselman's Blog
Viewing all articles
Browse latest Browse all 1148

Don't forget about the GitHub Command Line

$
0
0

I spend so much time at the command line using the Windows Terminal. Then I spend a ton of time using git at the command line. But then I ALT+TAB over to GitHub and mess around in the browser.

Why have I been sleeping on the GitHub CLI? - there's a command line interface for GitHub!

I installed with "winget install GitHub.cli" but you can get it from https://cli.github.com if you like.

Then you run gh auth login once:

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

Now you've got a new command "gh" to play with!

I went over to one of my local git clones for the Hanselminutes Podcast website and I can now list the open Pull Requests from the command line!

Open PRs on GitHub

Here's the real time saver that Dan Wahlin reminded me about: gh repo create!

> git init

Initialized empty Git repository in D:/github/ghcliblogpost/.git/
> gh repo create
? Repository name ghcliblogpost
? Repository description This is a test for my GH CLI Blog post
? Visibility Public
? This will add an "origin" git remote to your local repository. Continue? Yes
✓ Created repository shanselman/ghcliblogpost on GitHub
✓ Added remote https://github.com/shanselman/ghcliblogpost.git

Fantastic! You can even gh issue create!

gh issue create


Creating issue in shanselman/hanselminutes-core

? Title This is a test issue
? Body <Received>
? What's next? Submit
https://github.com/shanselman/hanselminutes-core/issues/219

Checking out a Pull Request is a great time saver as well. Go check out http://cli.github.com/ and see how it can help you today!


Sponsor: Protect your apps from reverse engineering and tampering with PreEmptive, the makers of Dotfuscator. Dotfuscator has been in-the-box with Microsoft Visual Studio since 2003. Visit preemptive.com/hanselminutes for a professional-grade trial.



© 2021 Scott Hanselman. All rights reserved.
    

Viewing all articles
Browse latest Browse all 1148

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>