Creating new repository or push an existing repository to github by command line

Create a new repository

echo "# [project name]" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/[your github account]/[project].git
git push -u origin master

Push an existing repository

git remote add origin https://github.com/[your github account]/[existing project].git
git push -u origin master
Show your support

Clapping shows how much you appreciated Luis Wu’s story.