Mercurial-您如何将回购的源导出到生产站点? [英] Mercurial - How do you export your repo's source to a production site?

查看:82
本文介绍了Mercurial-您如何将回购的源导出到生产站点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试通过打开回购更改日志在Tortoise HG中使用archive.这似乎不像SVN的export命令,在这里我可以简单地将远程存储库导出到当前目录.我用它来获得生产的原始副本(没有注释和存储库数据).在HG中我该怎么做?或者,我应该只使用克隆并手动处理与回购相关的数据吗?

I've tried using archive in Tortoise HG by opening my repo change log. This doesn't seem to be anything like SVN's export command, where I can simply export a remote repository to the current directory. I use this to get a clean copy of my source for production (without notes and repository data). How can I do something like this in HG? Or, should I just use clone and deal with the repo related data manually?

顺便说一句,由于我不会在Linux服务器上使用Tortoise HG,因此我需要通过命令行完成所有操作.

BTW, I need to do this all via command line since I'm not going to be using Tortoise HG on my Linux server.

非常感谢您的帮助.

推荐答案

正如其他答复指出的那样,hg archive可以执行您想要的操作-它将存档文件或只是文件布局,但如果可以运行,在服务器上,我是否建议将服务器克隆,并带有一个在接收到新变更集时更新的钩子?只要您不在实时服务器上进行编辑,就不会发生合并冲突,因此这是安全的操作.

As other responses have pointed out hg archive can do what you want -- it will do archive files or just a file layout, but if you can run mercurial on the server might I suggest making the server a clone, with a hook that updates whenever new changesets are received? So long as you're not editing on the live server there won't be merge conflicts, so it's a safe action.

在服务器上:

hg clone ssh://host//path/to/dev/repo

,然后在服务器的.hg/hgrc文件中添加以下行

and in the server's .hg/hgrc file add these lines

[hooks]
changegroup = hg update

然后,在更新开发仓库时进行部署:

Then as you update on the dev repo to deploy you just do:

hg push ssh://server/path/to/deployrepo

然后您可以将您的存储库中的内容推送到服务器,它会自动更新.

and then you can push from your repo to your server and it'll automatically update.

这篇关于Mercurial-您如何将回购的源导出到生产站点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆