C/C++教程

CentOS7安装mercurial(hg)

本文主要是介绍CentOS7安装mercurial(hg),对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

参考资料:

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

这篇关于CentOS7安装mercurial(hg)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!