和Git类似,Mercurial 是一个分布式的源代码
配置文件
位于:~/.hgrc
或 %USERPROFILE%\Mercurial.ini
首先配置用户名(注意格式,这样,google code等会为我们将email地址隐藏掉):
[ui]
username = John Doe <john@example.com>
记住用户名和密码:
[auth]
example.prefix = https://hg.example.net/
example.username = foo
example.password = bar
操作
Mercurial | Subversion | |
---|---|---|
仓库克隆 | hg clone url dir | svn co url dir |
创建 | hg init | svnadmin create dir |
提交到远端 | hg commit hg push |
svn commit |
更新 | hg pull hg update |
svn update |
获取版本号 | hg -q id hg parent |
svnversion -n |
参考
- http://mercurial.selenic.com/wiki/QuickStart
- http://mercurial.selenic.com/wiki/FAQ