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.
- 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
-
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>
- Update your local repository by adding files to your directory. Then type in the Terminal:
hg add
- Commit your changes to the local repository. Type in the Terminal:
hg commit -m "Initial commit of all files to the repository."
-
Push your changes to the remote repository. Type in the Terminal:
hg push http://bitbucket.org/MY_USER/MY_REPO
You're done.