##Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:alexpchin/<reponame>.git
git push -u origin master
##Push an existing repository from the command line
git remote add origin git@github.com:alexpchin/<reponame>.git
git push -u origin master
First of all use github cli
Authenticate github to use command line
Once you successfully authenticated , now you can create your repo from command line
Here the repo-name could be the repo name you want to use and --flag is if you want to make the repo private or public if you want to make it public use --public for private --private
for example this will create myrepo as public repository
gh repo create myrepo --public
once you created the repo, now you can initiate git in your current directory project using
to add the rest of your files use
if you face any error , you might need to check which branch is in use , you can change the branch using the following command
now you can push the file to your repo