How can I use Git with multiple remote repositories?
I use currently use Heroku for rails hosting which uses a Git repository for deployment. I als开发者_开发百科o 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)
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
精彩评论