Skip to content

Instantly share code, notes, and snippets.

@niiccolas
Created June 5, 2019 19:43
Show Gist options
  • Save niiccolas/4c47d0deceadd79dc446f3659d85e9ba to your computer and use it in GitHub Desktop.
Save niiccolas/4c47d0deceadd79dc446f3659d85e9ba to your computer and use it in GitHub Desktop.
Create a new GitHub repository from the command line

No place like home to create a GitHub Repo

Home is where the command line is

Below is a step by step process to create a GitHub repo from the command line. Before following these steps, create and navigate to the folder that will host the repository.

  1. git init
  2. echo "# Short project description" > README.md
  3. git add README.md
  4. git commit -m "Initial commit"
  5. curl -u '<YOUR_GITHUB_USERNAME>' https://api.github.com/user/repos -d '{"name": "<REPO_NAME>"}'
  6. git remote add origin [email protected]:<YOUR_GITHUB_USERNAME>/<REPO_NAME>.git
  7. git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment