Last updated November 07, 2012 19:13, by nvause

» Project Kenai Documentation and Training    » How Do I ...    » Source Code Management

Using Mercurial on UNIX and Mac Systems

Once you have a Mercurial client installed on your local system, you can check out code and check it back into your project repository. The following instructions for command-line Mercurial should get you started. For full instructions on using Mercurial, see

Note: Because of better security and better handling of large files, it's best to use the SSH protocol to check files into your project repository. Before using SSH with Project Kenai, you have to generate an SSH key pair and save the public key to the SSH Keys tab in your user profile. For more information on generating SSH keys, see Generating an SSH Key.

  1. To initially set up your repository, you need to know the name of the project and the name of the source repository. For example, for a project named bluebird with a Mercurial repository named bluebird~mercurial-code-repository, the secure read-write URL would be:
  2. Change directories to where you want your new hg repository directory to be created, then do the initial clone and create:
     > cd ~
     > hg clone ssh:// bluebird-hg
  3. Change directories to the new directory:
     > cd bluebird-hg
  4. Copy a file to the local working copy and then add it in hg.
     > cp ~/myjavafiles/
     > hg add
  5. Commit the file to the local repository.
     > hg commit -m"First commit to bluebird repository"
  6. Pull any changes from the server repository:
     > hg pull
  7. Update the local working copy:
     > hg update
  8. Check the file into your project repository on the server:
     > hg push
  9. When the system accepts your entries, you see the following responses for the initial checkin:
     adding changesets
     adding manifests
     adding file changes
     added 1 changesets with 1 changes to 1 files

Project Features

Wiki Controls

About this Project

Help for Site Tools was started in November 2009, is owned by kenaiadmin, and has 64 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
Please Confirm