Mac安装使用hg命令

最近研究JVM源码,看的书是<<实战java虚拟机>>,书里有要用以下命令下载jdk10的源码

hg clone http://hg.openjdk.java.net/jdk10/jdk10

然后了解下hg命令,原来hg是Mercurial(轻量级分布式版本控制系统)的命令,Mercurial 与Git类似,也是版本管理工具。

Mac上要使用hg命令,只需要安装Mercurial 即可,我在网上找到资料,安装使用如下命令

sudo easy_install mercurial

但是这个命令执行并不成功,如下图一样报了很多错误然后结束了。

于是又找其他的方案,参考http://macappstore.org/mercurial/ 里的说明

Press Command+Space and type Terminal and press enter/return key.
# 打开Termial终端
Run in Terminal app:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
and press enter/return key.
# 在终端中执行 "ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null" 命令然后回车

If the screen prompts you to enter a password, please enter your Mac's user password to continue. When you type the password, it won't be displayed on screen, but the system would accept it. So just type your password and press ENTER/RETURN key. Then wait for the command to finish.
# 如果需要输入密码就输,输的时候可能在屏幕上面并不展示,但是实际上是输入进去的了,输入完以后回车

Run:
brew install mercurial
# 然后执行 `brew install mercurial` 命令

Done! You can now use mercurial.
# ok了,可以用了

安装好后,执行hg命令会有相应的提示,就说明安装成功了,就可以进行源码的下载了

@localhost ~ % hg
Mercurial Distributed SCM

basic commands:

 add           add the specified files on the next commit
 annotate      show changeset information by line for each file
 clone         make a copy of an existing repository
 commit        commit the specified files or all outstanding changes
 diff          diff repository (or selected files)
 export        dump the header and diffs for one or more changesets
 forget        forget the specified files on the next commit
 init          create a new repository in the given directory
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值