tags:

views:

69

answers:

1

I use currently use Heroku for rails hosting which uses a Git repository for deployment. I also have a hosted Git repository that I use as my main source control for history/backup purposes. I would like to have 1 local folder that has my working copy of my application, then be able to commit my changes to either the Heroku repository, or my hosted repository when needed.

How do I do this? (note that I am familiar with how Team System does source control and am very new to Git)

+4  A: 

Add them both as remotes:

git remote add origin ssh://myserver.example.com/var/git/myapp.git
git remote add hosted ssh://myotherserver.example.com/var/git/myapp.git

[1] http://toolmantim.com/thoughts/setting_up_a_new_remote_git_repository

[2] http://www.kernel.org/pub/software/scm/git/docs/git-remote.html

bstpierre
You just hit submit 5 seconds before I was going to.
Warren Noronha
Calling them both origin is not such a good idea. I prefer to name remotes according to the server or service which hosts the repo.
Abizern
I think you might need to specify different names for each of the remotes, instead of "origin". For example, call the first one "origin" and the second "hosted".
Jeet
bstpierre