Mercurial -- An Excellent Version Control Tool

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://[email protected]/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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章