从 Mercurial 中的单个本地存储库推送到多个远程存储库
我正在考虑使用 AppHarbor 托管一个轻量级网站,并正在研究他们的 Mercurial 集成。
目前我使用 Kiln 作为远程存储库,但目前 AppHarbor 仅支持 BitBucket 集成。
一个本地存储库可以有 2 个远程存储库吗?那么,当我从本地推送提交时,它们都会收到推送吗?
我不想从 BitBucket 中拉取,只想推送,以便 AppHarbor 可以抓取并部署它。
I was considering using AppHarbor to host a lightweight website and was investigating their Mercurial integration.
Currently I use Kiln for my remote repositories, but currently AppHarbor only supports BitBucket integration.
Is it possible to have 2 remote repositories for a single local repository? So when I push commits from my local, they both get the push?
I don't ever want to pull from BitBucket, only push so that it can then be grabbed by AppHarbor and deployed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在存储库配置文件的
[paths]
部分设置多个远程存储库别名。该文件位于 .hg/hgrc 中,您将添加这样的路径然后您将运行
hg push bitbucket
推送到 bitbucket 并运行hg Push
推送到 kiln,其中这里也是默认的。别名default
是在您未指定任何其他内容时使用的别名。这样,不带参数的推拉将使用您首选的远程主机 kiln。遗憾的是,您无法执行
hg Push *
类型的命令来一次推送到所有远程主机,您必须一一指定每个推送目的地。You can set multiple remote repository aliases in the
[paths]
section of the repository configuration file. This file is in .hg/hgrc, and you would add paths like thisThen you would run
hg push bitbucket
to push to bitbucket andhg push
to push to kiln, which is also the default here. The aliasdefault
is the one that's used when you don't specify anything else. This way push and pull with no arguments would use your preferred remote host, kiln.Sadly you can't do a
hg push *
type command to push to all remote hosts at once, you have to specify each push destination one by one.我不确定您是否可以编辑 Bitbucket/Kiln 上的 hgrc 文件。如果可以的话,您也许可以自动执行此操作。如果没有,您可以推送到另一个本地副本,然后使用 Hooks 推送到 Bitbucket 和 Kiln。请参阅 Ton 的回答(为了方便起见,包含在下面):
I'm not sure if you can edit the hgrc file on Bitbucket/Kiln. If you can, you may be able to make this automatic. If not, you could push to another local copy, which then pushes to both Bitbucket and Kiln using Hooks. See this answer by Ton (included below for convenience):