Skip to content

Instantly share code, notes, and snippets.

@arthurdapaz
Forked from alexpchin/Setting_upa_new_repo.md
Last active November 7, 2020 15:21
Show Gist options
  • Save arthurdapaz/6005e45353a2c5308c30fa7635a5dc7a to your computer and use it in GitHub Desktop.
Save arthurdapaz/6005e45353a2c5308c30fa7635a5dc7a to your computer and use it in GitHub Desktop.
Create a new repository on the command line

Setting up a new Git Repo

##Create a new repository on the command line

REPO="REPO_NAME_HERE"
curl -u 'USER' https://api.github.com/user/repos -d '{"name":"$REPO"}'
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:arthurdapaz/$REPO.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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment