Reputation: 6205
I am new to using Github.
I am studying Ruby on Rails with a computer and successfully pushed everything to my github repository as well as to Heroku.
Now I am using a computer different from the first one I used.
The question is, how do I clone my github repository, make changes to the code, and push those changes to the original repository in github, and hopefully carry those changes to Heroku as well.
Upvotes: 4
Views: 654
Reputation: 362
When you clone a repository from github (and you are logged in form github) You have 3 options / links to "clone" your Repo.
If you are not logged in, only 2 options appear
In the file .git/config you can see which one you added, mostly under [remote "origin"]
url = [email protected]:username/project.git (SSH)
url = https://[email protected]/username/project.git (HTTP)
url = https://github.com/username/project.git (HTTP Read only)
url = git://github.com/username/project.git (Git Read only)
If you choose a read only, the best you can do is remove that remote with:
git remote rm origin
After that you can add a new remote:
git remote add origin https://[email protected]/username/project.git
(for http)
or
git remote add origin [email protected]:username/project.git
(for SSH)
HTTPS is the most easy to set up, but you will have to enter your password for every push / pull (unless you want to store your password plaintext)
After setting up the remote, you can push with git push origin branchname
More information can be found on the git manual page: http://help.github.com/remotes/
Upvotes: 1