版本控制 Mercurial

在BitBucket上使用Mercurial做代码版本控制:    BitBucket: 是一家源代码托管网站,采用Mercurial和Git作为分布式版本控制系统。
    GUI TortoiserHg: TortoiseHg is a set of graphical tools and a shell
    extension for the Mercurial distributed revision control system.
Mercurial 常用命令:

    hg clone repository :这里repository是源码的地址
    hg add              :add new file
    hg commit -m 'My changes'  :-m增加修改信息,
    注:提交后要push,changeset才能上传到远程仓库上
    hg push   :推入远程仓库
    hg pull   :下拉changeset
    hg merge  :合并分支
    hg update :更新
    hg status :show changed files in the working directory
    hg forget :forget the specified files on the next commit
    hg remove :remove the specified files on the next commit import
提交代码的一般步骤:
    $hg commit //为本地changes创建一个节点
    $hg pull   //检查远程仓库是否有别人新的changes。
    $hg merge  //如果有别人的更新。
    $hg push   //将changes推入远程仓库。

在.hg/hgrc中配置扩展

配置vimdiff:

[extensions] 
hgext.extdiff = 
[extdiff]
cmd.vimdiff = 
// 添加后使用 hg vimdiff [file] 查看

配置用户名:

    [ui]
    username = 

配置扩展操作mq:

    [extensions]
    mq =

补丁的常用命令:

    hg qnew 创建一个补丁
    hg qpush 将补丁压栈
    hg qpop  将补丁弹栈
    hg qrefresh 刷新补丁,将新的changes刷入补丁
    hg qfinish  将补丁转换成commit
    hg qrename  补丁更名
    hg qunapplied print the patches not yet applied
    hg qdelete  删除某个未使用的补丁(unapplied)

关于补丁的一些官方资料:

GUI:  http://tortoisehg.bitbucket.org/manual/2.0/patches.html
http://mercurial.selenic.com/wiki/MqExtension/
http://mercurial.selenic.com/wiki/MqTutorial

HGRC:

http://www.selenic.com/mercurial/hgrc.5.html


 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值