Installing Mercurial on Mac OS X

Installing Mercurial on Mac OS X requires only a few steps. After you've downloaded the right Mercurial package for your system, unzipped it and ran the installer (.pkg), you have a command line tool installed in your shell (Terminal). Mercurial requires that you start a new project to run the first time. First, you need to get your username and password from the site running Mercurial (in my case is BitBucket). Then you can follow these steps.

  1. Go to a directory on your local drive and clone your remote repository. Type in the Terminal:
    cd directory
    hg clone http://bitbucket.org/MY_USER/MY_REPO
    
  2. Edit your hgrc file in your newly created local repository and add these lines:
    # This is a Mercurial configuration file.
    [ui]
    username = John Doe <johndoe@gmail.com>
    
  3. Update your local repository by adding files to your directory. Then type in the Terminal:
    hg add
    
  4. Commit your changes to the local repository. Type in the Terminal:
    hg commit -m "Initial commit of all files to the repository."
    
  5. Push your changes to the remote repository. Type in the Terminal:
    hg push http://bitbucket.org/MY_USER/MY_REPO
    

You're done.

Leave a Reply

Note: Only a member of this blog may post a comment.