Skip to content

Instantly share code, notes, and snippets.

@ganeshchand
Last active June 25, 2016 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ganeshchand/bab0cffcbe9b006c4a143014e02db1c9 to your computer and use it in GitHub Desktop.
Save ganeshchand/bab0cffcbe9b006c4a143014e02db1c9 to your computer and use it in GitHub Desktop.
If you have already a git repository in your computer, login to github, create a repository. It should give you a link to remote origin.
adding an existing repo to remote repository:
You need to decide whether to use ssh or https. If you use https, you get prompted for github userid/password everytime you push.
So, using ssh is preferred.
Follow these steps if you haven't added SSH key of the computer you are working with into your github account.
``
ssh-keygen -t rsa -b 4096 -C "your email adddress"
ssh-add ~/.ssh/id_rsa
pbcopy < ~/.ssh/id_rsa.pub // this copies SSH key to clipboard
``
Now, go to your github account-> SSH and GPG keys-> New SSH Key
Enter the name
and Command+v to paste the keys
Add SSH key
Return to the terminal and push your master branch
`git push -u origin master`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment