The ultimate GitHub cheat sheet to work with your team at lightning speed
13 September 2021
In my previous article, we saw how I use Zsh shortcuts with git. It working great if you are alone on your project. But if you want to be effective in a team, you will need to have a workflow around GitHub.
gh is GitHub on the command line. It brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already working with git and your code.
Installation on macOS
You can install the CLI tool with brew if you are on macOS or from other sources.
brew install gh
When it's done you need to authenticate with your GitHub account.
gh auth login
If you already used git init and pushed your code, you can clone a repository or preview it on a webpage.
gh repo clone user/repo_name
gh repo view --web
Create a new branch
Working as a team, you need to branch out your work from the main (or master) branch. With gco -b you can checkout and create a new branch at the same time.
# Create a new branch, and switch to it
Create a pull request
Work and manage pull requests from the terminal.
# Create a new pull request on GitHub
gh pr create
# Launch your web browser
gh pr view --web
Browse all the commands on the official documentation.
Hi, I’m David, a french freelance developer working remotely. I’m the author of this blog, nice to meet you!
Be the first to receive insightful articles and actionable resources that help you to elevate your skills across every touch point.