参考资料:
https://blog.csdn.net/u012120103/article/details/116110195
http://www.360doc.com/content/12/0803/16/10487218_228137702.shtml
https://www.iteye.com/blog/yaofeng928-1146473
1、hg官网下载地址:
https://www.mercurial-scm.org/release/
2、安装Python3——跳过
3、安装依赖
yum -y install docutils
4、解压、安装
tar xf mercurial-5.7.tar.gz
# 如果要修改安装目录,修改文件Makefile中的PREFIX
vi Makefile export PREFIX=/usr/local/mercurial
# 编译安装
make install
5、添加环境变量
vi /etc/profile export
追加下面两行:
MERCURIAL_HOME=/usr/local/mercurial/
export PATH=$MERCURIAL_HOME/bin:$PATH
立即生效:
source /etc/profile
6、验证hg
hg –version
7、创建用户
useradd hguser -d /home/hguser
passwd hguser
8、建立hg代码库
mkdir -p /usr/hg/myproject
cd /usr/hg/myproject
hg init
9、测试
echo “Hello” > readme.txt
hg add ##添加
hg ci ##检查
注意:报这个错,用命令hg config –edit,编辑用户名
10、启动http server
chown hguser:hguser -R /usr/hg/myproject
cd /usr/hg/myproject
hg serve -p 8000 &
11、访问http
http:ip:8000
原创文章,作者:1402239773,如若转载,请注明出处:https://blog.ytso.com/271872.html