mercurial是又一个去中心化的版本管理软件,类似git

先介绍如何安装mercurial
yum -y install mercurial

mercurial需要一个用户名来记录commit动作
在用户根目录下创建文件.hgrc
并配置文件内容
[ui]
username = Yjken <yjken@xinfilm.com>
推荐使用Email作为用户名

ok,至此安装完成.

创建用于存放源码的文件夹
mkdir xinfilm

进入该目录
cd xinfilm

初始源码仓库
hg init

这时可以看到生成了".hg"文件夹
ls -a
显示:
. .. .hg

现在可以添加文件至mercurial
创建文件
touch hello.txt

ls
显示:
hello.txt

将该文件加入仓库
先打标识,表示需要加入仓库
hg add hello.txt
执行commit提交,这时已经真正加入仓库了
hg commit -m "adding initial version of hello.txt"

查看版本库历史记录
hg log
显示:
changeset: 1:89251717ca6e
tag: tip
user: Yjken <yjken@xinfilm.com>
date: Fri Jun 06 01:56:21 2014 +0800
summary: commit name.txt

changeset: 0:49336f35187e
user: Yjken <yjken@xinfilm.com>
date: Fri Jun 06 01:39:55 2014 +0800
summary: adding inital version of hello.txt
其中changeset,表示一次commit的变更情况
changeset: 1:89251717ca6e
这里的"1"表示版本1,后面"89251717ca6e"表示这次变更的ID

查看特定版本的变更记录
hg log -r2
表示查看版本2的变更信息

从仓库更新内容至本地拷贝
hg update -c
-c,--check 表示如果本地没有未提交的文件就会更新,如果有未提交的文件,不更新
-C,--clean 表示如果本地存在未提交的文件,会被丢弃,并更新文件
-d,--date 表示更新至某个日期
-r,--rev 表示更新至某个指定的版本
如:
hg update -r 1
表示更新至第一版

克隆其它已经存在的仓库至本地仓库
hg clone http://www.selenic.com/repo/hello my-hello
命令执行完成后,会看到my-hello目录下含有文件了

参与官方文档:http://mercurial.selenic.com/wiki/TutorialFirstChange

安装Mercurial进行版本管理的更多相关文章

  1. OpenJDK-study-001 windows上安装Mercurial 4.4.1 克隆OPENJDK版本库

     下载安装 1.下载Mercurial 进入https://www.mercurial-scm.org/wiki/Mercurial下载,windows上傻瓜式安装的,安装好之后,命令行进入安装目录, ...

  2. debian7(wheezy)升级安装mercurial hg最新版2.8-RC,解决tortoisehg2.9.2不能使用。

    debian&(wheezy)之前的仓库版本是2.2.2.  注: 本文以 # 为开始的行是工作在root下的模式,在终端显示为root的提示符# ,用户目录的($:)需要切换到root(使用 ...

  3. Node.js安装,多版本管理以及修改npm下载的镜像源

    注意:在操作之前建议先把整个文章看完,在决定要不要配置!!!!! 1.下载    地址:http://nodejs.cn/download/        根据系统对应版本下载文件 2.安装    下 ...

  4. linux安装nvm node版本管理器 nvm常用命令 部署node服务器环境

    1,nvm git地址点击打开链接,安装命令 curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh ...

  5. Ubuntu中安装 mercurial – TortoiseHG

    sudo add-apt-repository ppa:tortoisehg-ppa/releases sudo add-apt-repository ppa:mercurial-ppa/releas ...

  6. CentOS安装svn(subversion)版本管理

    yum -y install subversion svnadmin create /svn/repository cd /svn/repository/conf ll  查看文件-rw-r--r-- ...

  7. 版本管理工具Git(2)git的安装及使用

    下载安装git 官方下载地址:https://git-scm.com/download/win 这里以windows为例,选择正确的版本: 验证是否安装成功,右键菜单中会出现如下菜单: Git工作流程 ...

  8. Mercurial(HG) Windows+Eclipse安装、配置、使用

    Mercurial(HG) Windows客户端安装 Mercurial(HG): http://mercurial.selenic.com/ Windows客户端下载:http://mercuria ...

  9. Windows下完全卸载node.js并安装node.js的多版本管理工具nvm-windows

    前言 由于高版本的node.js导致gulp执行build命令失败,我需要在Windows下卸载掉已有的node.js并安装一个多版本管理工具nvm-windows,方便切换不同版本的node.js. ...

随机推荐

  1. js时间戳与日期格式的相互转换

    下面总结一下js中时间戳与日期格式的相互转换: 1. 将时间戳转换成日期格式: function timestampToTime(timestamp) { var date = new Date(ti ...

  2. Codility:Titanium 2016 challenge:BracketsRotation

    发现codility上很难找到自己的代码,所以来存一下. 用的一种水法,不知道是结论对还是数据水. 处理出所有极大合法串最后就只剩)))((((状的括号,然后枚举右端点,左端点单调. 但是未匹配点数量 ...

  3. Codeforces Round #411 (Div. 2)(A,B,C,D 四水题)

    A. Fake NP time limit per test:1 second memory limit per test:256 megabytes input:standard input out ...

  4. Codeforces 626B Cards(模拟+规律)

    B. Cards time limit per test:2 seconds memory limit per test:256 megabytes input:standard input outp ...

  5. hdu_2030

    一个小小知识点,统计字符串中汉字出现的次数,直接给出代码 //ASCII码的范围是0-127所以,超出范围的都是汉字,因为一个汉字占两个字符位置,所以结果除以2就可以了 #include<cst ...

  6. SpringMVC框架学习笔记——各种异常、报错解决

    1.Target runtime com.genuitec.runtime.generic.jee60 is not defined. 找到导入项目的.setting文件夹org.eclipse.ws ...

  7. 用于 C&sharp; 图像识别的轮廓分析技术

    用于 C♯ 图像识别的轮廓分析技术 供稿:Conmajia 标题:Contour Analysis for Image Recognition in C# 作者:Pavel Torgashov 此中文 ...

  8. Linux包管理器

    按Linux系统分类 Redhat系列:Redhat(本身就是Centos).Centos.Fedora等,采用Dpkg包管理器 Debian系列:Debian.Ubuntu等,使用RPM包管理器 R ...

  9. 搭建mybatis时的小问题

    1.源文件中的xml文件经过编译后没有打包到classes中去,在源文件包中写的mapper文件运行时找不到. 解决办法: pom文件build下添加编译时加入xml和resource文件下的所有文件 ...

  10. 给外行或者刚入门普及一下关于C#,.NET Framework(.NET框架),.Net,CLR,ASP,ASP.Net, VS,以及.NET Core的概念

    一.概念 1. C# :C#是微软公司发布的一种面向对象的.运行于.NET Framework之上的高级程序设计语言. 2..NET Framework(.NET框架):.NET framework ...