Quick Start to mercurial (HG) distributed version control

Source: Internet
Author: User
Tags mercurial redmine
Http://www.cnblogs.com/xjimmyshcn/archive/2011/06/17/2083437.html

Common version control software, such as SVN server (SVN) and VSS Administrator (VSS), all require a central server, but distributed version control software, such as mercurial, is not required. Of course, in actual use, it is generally necessary to manually specify a central library as the Publishing Server. The biggest advantage of distributed architecture is that it can work offline. Mercurial can directly create a local resource library and submit it locally. Submit it to the central server when you need to connect to the central server. Mercurial indicates moqiuli, which is the messenger of the gods in the mythology of Rome,The command line tool of mercurial is Hg. Mercurial has a lot of details on the Internet, so I won't go into details here. Here I will mainly talk about how to get started and use it quickly. Note: The following operations are performed in centos 5.6 i386 and the mercurial version is 1.8.4. In Windows, the tortoisehg version is 2.0.3.  
    • First, install mercurial using yum.
      Yum install mercurial

      The official centos installation source does not include mercurial, but is included in the rpmforge library. For more information, seeHttp://mercurial.selenic.com/wiki/Download= "1.4. Linux (. rpm)
      If the yum has not installed the rpmforge installation source, you can refer to another article 《Yum Quick Start-add common plug-ins and rpmforge installation sources for yum"

  • Check Installation
    View version

    [Root @ svn_server mercurial] # Hg -- version
    Check Installation[Root @ svn_server mercurial] # Hg debuginstall
  • Create user
    Useradd hguser-D/home/hguser
    Passwd hguser

  • Create HgCodeLibrary
    Mkdir-P/usr/Hg/myproject
    CD/usr/Hg/myproject
    Hg init

  • Test
    Echo "Hello world! "> Readme.txt
    Hg add # Add
    Hg CI # check in

  • Start HTTP Server
    Chown hguser: hguser-r/usr/Hg/myproject

    CD/Usr/Hg/myproject
    Hg serve-P 8000 &

  • Access HTTP
    Http: // yourip: 8000

----------------------------------------------------------------------------------

If you want to access this Hg project in Windows, you can download and install tortoisehg. After tortoisehg is installed, it can be integrated into the right-click menu of the resource manager. By using the clone function, you can copy the project on the server, for example:

 

During clone, the source is a remote server (which can be obtained through SSH), and the target is an empty directory.

Right-click the Hg workbench window in the menu and you can download the project pull (checkout download) and push (checkin upload)

After pull, mercurial does not update the working directory by default. You need to perform the update operation in Hg workbench.

-------------------------------------------------------- Mercurial can also be integrated with redmine. After configuring mercurial in redmine, you can view the mercurial version library in redmine.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.