GitHub is where your code lives online. Other services like Vercel connect to it to deploy your app. The GitHub CLI (gh) lets you create repos and manage GitHub from the terminal.
Quick links: github.com (account) · cli.github.com (CLI download)
- Go to github.com
- Click Sign up
- Follow the prompts — a free account is all you need
- Use the same email you configured with Git (
git config --global user.email)
The GitHub CLI (gh) lets you create repositories, push code, and manage GitHub without leaving the terminal.
Option A: Homebrew (recommended if you have it)
brew install ghOption B: Download the installer
- Go to cli.github.com
- Click Download for macOS
- Open the downloaded
.pkgfile and follow the prompts
- Go to cli.github.com
- Click Download for Windows
- Run the downloaded
.msiinstaller - Click through the prompts with defaults
- Restart your terminal after installation
gh --versionYou should see something like gh version 2.x.x.
Run:
gh auth loginFollow the prompts:
- Where do you use GitHub? →
GitHub.com - What is your preferred protocol? →
HTTPS - Authenticate Git with your GitHub credentials? →
Yes - How would you like to authenticate? →
Login with a web browser - Copy the one-time code shown in the terminal
- Press Enter — a browser window opens
- Paste the code and click Authorize
You're now authenticated. You can create repos and push code from the terminal.
Once authenticated, the most important command for the hackathon is creating a new repo:
gh repo create slow-hackathon --public --source=. --pushThis creates a new repository on your GitHub account from the current folder and pushes all your code to it in one step.
| Problem | Fix |
|---|---|
gh: command not found |
Restart your terminal. On Windows, make sure to close and reopen after installing. |
| Authentication fails | Run gh auth logout then gh auth login to start fresh. |
| "Permission denied" when pushing | Make sure you selected "Authenticate Git with your GitHub credentials" during gh auth login. Run gh auth login again if needed. |
| Browser doesn't open during login | Copy the URL shown in the terminal and paste it into your browser manually. |