Skip to content
David Galiata
Go back

Creating GitHub Repositories from CLI

Creating GitHub Repositories from CLI

Picture this: You’ve just built a small app and want to share it with the world. Let’s learn how to create a GitHub repository straight from your terminal.

Prerequisites

Terminal window
# Install GitHub CLI
# macOS
brew install gh
# Windows
winget install GitHub.cli

Quick Setup

Navigate to your project:

Terminal window
cd ~/projects/weather-dashboard

Initialize Git:

Terminal window
git init
git add .
git commit -m "First forecast: Initial commit"

Authenticate with GitHub:

Terminal window
gh auth login

Create and push your repository:

Terminal window
gh repo create weather-wizard --public --source=. --push

Command Breakdown

Let’s analyze that last command:

Advanced Options

Add metadata:

Terminal window
gh repo create climate-tracker \
--description "Real-time weather monitoring dashboard" \
--homepage "https://weather-app.example.com" \
--public --source=. --push

Create with license:

Terminal window
gh repo create forecast-pro --license "mit" --public --source=. --push

Troubleshooting

Common issues:

Final Thoughts

GitHub CLI transforms repository creation into a streamlined process. No more context switching between terminal and browser - just efficient, focused development.


Written for folks who value their time


Share this post:

Previous Post
The Consulting Mindset
Next Post
Building an AI Security Program