All writing

Creating a Git Repository via Command Line

A quick guide on how to create a new Git repository via the command line.

First make sure you install the gh CLI tool. You can do that by running the following command:

plain text
brew install gh

Make sure you are logged in to your GitHub account. You can do that by running the following command:

plain text
gh auth login
plain text
git init

Then you can run the following command to create a new private repository:

plain text
gh repo create app-name --private
plain text
git remote add origin git@github.com:jerrickhakim/app-name.git

Set your branch

plain text
git branch -M main
git add .
git commit -m "First commit" 
git push --set-upstream origin main