Linux下Mercurial (hg)配置说明
|
这个工具在国内很少人使用,所以中文资料匮乏.只有官方的website上有一些少得可怜的中文资料了.不过总体上来说,hg还是比较好用的。 这里绍一下hg服务器的配置。关于hg在基本用法参见mercrial的官方网站。在做以下操作时,请到 http://www.selenic.com/mercurial/下载安装hg. 1.建立用户hgrepo 其它用户将用这个账户用hg服务器push代码。 useradd hgrepo -d /home/hgrepo # add user hgrepo 2.建立hg代码仓库 如果代码仓库名称为project.hg,则可用如下命令。 cd /home/hgrepo echo "hello, mercurial" > sample.txt 3. 打开http 打开一个端口,让远程用户可以clone仓库中的代码. 更改文件权限 cd /home/hgrepo/project.hg -R 4.使用hg 完成步骤3以后,我们就可以使用了。 clone到本地 例如你的服务器的名字为test. hg clone http://test:8002 修改Client端的配置 更改.hg/hgrc,加上default-push和username [paths] Good Luck. 官方网站 http://www.selenic.com/mercurial/ |
