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
# create the first file in the project
# git isn't aware of the file, stage it
git add README.md
# 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 https://github.com/YOUR-USERNAME/YOUR-REPOSITORY.git
# push changes to github
git push --set-upstream origin main