Skip to content

Instantly share code, notes, and snippets.

@vanderhoop
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save vanderhoop/922a574dd882bc4a8ac2 to your computer and use it in GitHub Desktop.

Select an option

Save vanderhoop/922a574dd882bc4a8ac2 to your computer and use it in GitHub Desktop.

Setting Up A GitHub Repo for Hosting Hitherto Local Code

  1. First, you'll need a local repo with some committed code.
  2. Next, you'll have to create a repo on GitHub.com, which can be done by clicking on the plus sign next to your name and following the ensuing prompts.
  3. When the GitHub repo is created, it's still just an empty vessel. It knows nothing about your local code, and, similarly, your local code knows nothing about GitHub. To let the two talk to one another, we need to copy the ssh clone url (which is used to verify that you are who you say you are) found on the right side of the repo page before proceeding to step 5.
  4. Now add a remote repo with the following command: git remote add <repo_name> <branch_name> <ssh_clone_url> where <branch_name> is typically master and <repo_name> is whatever you choose, though it's common to call it origin.
  5. You can check to see if the remote repo was added correctly by using git remote -v
  6. If the remote was added, use git push <remote_repo_name> <branch_name> where <remote_repo_name> is likely origin and <branch_name is likely master.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment