DEV Community

Cover image for You need to know about Github CLI
Luiz Calaça
Luiz Calaça

Posted on

7 2

You need to know about Github CLI

Hi, Devs!

What is GitHub CLI: A Command Line Interface to handle easily: repo clones, pull requests, merges, issues, gists and much others

Documentation: https://cli.github.com/manual/

Installation

//Mac
brew install gh
//Linux
https://github.com/cli/cli/blob/trunk/docs/install_linux.md
Enter fullscreen mode Exit fullscreen mode

Are you going to clone a repo?

gh auth login
gh repo list
gh repo clone <repo_name_from_list>
Enter fullscreen mode Exit fullscreen mode

Yes, you don't need to go to the Github page, all in one CLI tool you could clone a project.

Creating, deleting and configuring a repository

gh repo create

gh repo create <name_of_repo> --public

gh repo create my-project --private --source=. --remote=upstream

gh repo edit --visibility <visibility-string>

gh repo sync

gh repo create --disable-issues=true --public

gh repo list

gh repo delete <name_of_repo>

gh repo clone <name_of_repo>

gh repo fork <name_of_repo>
Enter fullscreen mode Exit fullscreen mode

Locally, you create your project with git init, commit your files and after you should go to the gh repo create and would be created remotely the repo and locally configured with the remote origin:

mkdir project && cd project

git init

gh repo create 
Enter fullscreen mode Exit fullscreen mode

Usually, when you are programming you think should be possible to save a piece of code. You can use the Gist:

Creating a gist easily

touch index.js // after create content for it

gh gist create index.js --public

gh gist create -

gh gist edit <gist_id> 

gh gist list --public 

gh gist list --secret
Enter fullscreen mode Exit fullscreen mode

Handling issues

gh issue create

gh issue list

gh issue status

git issue close <#number_issue>

gh list -A "<name_issue>"
Enter fullscreen mode Exit fullscreen mode

Handling Pull requests

gh pr create 

gh pr checkout <name>

gh pr diff <#number_of_pr>

gh review -c -b "nice work"

gh pr close <#number_of_pr> -d

gh pr reopen <#number_of_pr>

gh pr status
Enter fullscreen mode Exit fullscreen mode

If you get started to use certainly you'll see that's so great tool.

Contacts
Email: luizcalaca@gmail.com
Instagram: https://www.instagram.com/luizcalaca
Linkedin: https://www.linkedin.com/in/luizcalaca/
Twitter: https://twitter.com/luizcalaca

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

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

Okay