Skip to content

Instantly share code, notes, and snippets.

@andineck

andineck/0-readme.md

Last active Sep 2, 2015
Embed
What would you like to do?
github: add repo via command line

github cmd

  1. how to create and init a git repository
  2. how to create and init a git repository for an organization
# create and init a git repository for an organization
# replace: USER, ORG, PASSWORD, REPO in this script
# cd into your development directory
# with a user repo
curl -u USER:PASSWORD https://api.github.com/user/repos -d '{"name":"REPO"}'
mkdir REPO && cd REPO
git init
touch readme.md
git add .
git commit -m initial
git remote add origin https://github.com/USER/REPO.git
git push -u origin master
# create and init a git repository for an organization
# replace: USER, ORG, PASSWORD, REPO in this script
# cd into your development directory
# org repo
curl -u USER:PASSWORD https://api.github.com/orgs/ORG/repos -d '{"name":"REPO"}'
mkdir REPO && cd REPO
git init
touch readme.md
git add .
git commit -m initial
git remote add origin https://github.com/ORG/REPO.git
git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment