GitHub – Start a new repository and publish it

First, you need to create a repository on github.

# create a new directory, and initialize it with git-specific functions
git init my-repo

# change into the `my-repo` directory
cd my-repo

# create the first file in the project

# git isn't aware of the file, stage it
git add

# take a snapshot of the staging area
git commit -m "add README to initial commit"

# provide the path for the repository you created on github
git remote add origin

# push changes to github
git push --set-upstream origin main