0. Install a mercurial on Ubuntu
sudo apt-get install mercurial
1. Create a project and commit
> hg init my_dir
> [ add some files ]
> hg add [new files or directories]
> hg commit -u username
2. Clone a project
hg clone ssh://user@IP//tmp/test
hg update
OR
hg clone https://user@bitbucket.org/dst
hg update
3. Status and Summary
hg status
hg summary
4. Revert and diff
hg diff [ file]
hg revert -r version
hg revert file
5. Push and Pull
hg push ssh://user@IP//tmp/test
hg pull ssh://user@IP//tmp/test
6. Update
hg tip
hg update
hg update version
7. View the log
hg log
hg log -v -r version
hg log -v -p -r version
8. Remove and rollback
hg rm file or dir
hg rollback // Only for once !
9. Export and import
hg export changeset > 1.patch
hg import 1.patch
本文详细介绍Mercurial版本控制系统的基本使用方法,包括安装、创建和提交项目、克隆项目、查看状态和日志、撤销更改、推送和拉取代码等关键步骤。
253

被折叠的 条评论
为什么被折叠?



