DEV Community

Kavin Desi Valli
Kavin Desi Valli

Posted on • Originally published at livecode247.com on

Control your Github from the command line with the Github CLI

Want to create a repository, but don't want to go to Github and follow that manual and perhaps long process, every single time.

Use the Official Github CLI. It can do a lot of stuff ranging from creating a repo to closing a PR. I have written down some important commands in this blog post. (Have also linked the docs for the commands)

Login

First, to use some of the commands listed below, you will have to authenticate the CLI by running

gh auth login

Enter fullscreen mode Exit fullscreen mode

Creating a repository

This is probably the command I use the most

gh repo create repo_name

Enter fullscreen mode Exit fullscreen mode

List repositories of a user

gh repo list username

Enter fullscreen mode Exit fullscreen mode

View Repository in web

View any repository in web

gh repo view owner/repo_name --web

Enter fullscreen mode Exit fullscreen mode

View the repository you're currently in (cloned repository)

gh repo view --web

Enter fullscreen mode Exit fullscreen mode

Aliases

List Aliases

gh alias list

Enter fullscreen mode Exit fullscreen mode

Set Alias

gh alias set <alias> <expansion>

Enter fullscreen mode Exit fullscreen mode

Delete Alias

gh alias delete <alias>

Enter fullscreen mode Exit fullscreen mode

These are my most used commands but there are a lot more which can be found on the Github CLI Docs. And most of these commands listed above can also be used with some flags which are listed in the documentations.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay