git - 如何将 Git 与多个远程存储库一起使用?

标签 git heroku

我目前使用 Heroku 进行 rails 托管,它使用 Git 存储库进行部署。我还有一个托管的 Git 存储库,我将其用作用于历史/备份目的的主要源代码控制。我想要 1 个本地文件夹,其中包含我的应用程序的工作副本,然后能够在需要时将我的更改提交到 Heroku 存储库或我的托管存储库。

我该怎么做? (请注意,我熟悉 Team System 如何进行源代码控制并且对 Git 非常陌生)

最佳答案

将它们都添加为 Remote :

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

关于git - 如何将 Git 与多个远程存储库一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3277792/

相关文章:

git - 引入 git switch 后,git checkout 还能做什么?

git 差异 : what is the difference between --cached and --staged

eclipse - 如何使用 JGit 将文件重置为特定提交?

git - 禁用/更改 Visual Studio Team Services 自动解释散列号提交消息

ruby-on-rails - 'identify'命令无法识别图像文件。 (heroku)

git - 无法将 master 推送到 heroku

java - 避免硬编码 Heroku Procfile jar 名称?

ruby-on-rails - 使用回形针将 Heroku 上的图像上传到 Amazon s3 时 Rails 访问被拒绝

java - Springboot 可执行 JAR - 错误 : Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean

heroku - 在Heroku中部署时出错:es不是有效的语言环境