Skip to content

Instantly share code, notes, and snippets.

@yuhangch
Last active April 7, 2020 05:29
Show Gist options
  • Save yuhangch/8a0df1eb88681871800b36ee3d365377 to your computer and use it in GitHub Desktop.
Save yuhangch/8a0df1eb88681871800b36ee3d365377 to your computer and use it in GitHub Desktop.
Config New Local Repository to Github by Cli

create a new repository on the command line

echo "# RepoName" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:username/RepoName.git
git push -u origin master

push an existing repository from the command line

git remote add origin git@github.com:username/RepoName.git
git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment