<?xml version="1.0" encoding="UTF-8"?>
<page>
  <created-at type="datetime">2008-08-04T18:31:22Z</created-at>
  <description>Changed instuctions to use ssh</description>
  <id type="integer">106</id>
  <name>Usinghg-unixmac</name>
  <number type="integer">14</number>
  <person-id type="integer">7</person-id>
  <text>[[Home|&amp;raquo; Project Kenai Documentation and Training]] &amp;nbsp;&amp;nbsp; [[Howdoi|&amp;raquo; How Do I ...]] &amp;nbsp;&amp;nbsp; [[SourceControl#About_Mercurial|&amp;raquo; Source Code Management]]

==Using Mercurial on UNIX and Mac Systems==

Once you have a &lt;a href=&quot;SourceControl#About_Mercurial&quot;&gt;Mercurial client&lt;/a&gt; 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 [http://hgbook.red-bean.com/]. 

'''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 [[ProfileSettings#SSH_Keys|SSH Keys tab]] in your user profile. For more information on generating SSH keys, see  [[GeneratingAnSSHKey|Generating an SSH Key]].

# To initially set up your kenai.com repository, you need to know the name of the project and the name of the source repository. For example, for a project named &lt;tt&gt;bluebird&lt;/tt&gt; with a Mercurial repository named &lt;tt&gt;bluebird~mercurial-code-repository&lt;/tt&gt;, the secure read-write URL would be:&lt;br/&gt;&lt;tt&gt; &amp;nbsp;&lt;nowiki&gt;ssh://&lt;/nowiki&gt;''your-username''&lt;nowiki&gt;@hg.kenai.com/bluebird~mercurial-code-repository&lt;/nowiki&gt;&lt;/tt&gt;
# Change directories to where you want your new hg repository directory to be created, then do the initial clone and create:&lt;br/&gt;&lt;tt&gt;&amp;nbsp;&gt; cd ~&lt;/tt&gt;&lt;br/&gt;&lt;tt&gt;&amp;nbsp;&gt; hg clone &lt;nowiki&gt;ssh://&lt;/nowiki&gt;''your-username''&lt;nowiki&gt;@hg.kenai.com/bluebird~mercurial-code-repository&lt;/nowiki&gt; bluebird-hg&lt;/tt&gt;
# Change directories to the new directory:&lt;br/&gt;&lt;tt&gt;&amp;nbsp;&gt; cd bluebird-hg&lt;/tt&gt;
# Copy a file to the local working copy and then add it in hg.&lt;br/&gt;&lt;tt&gt;&amp;nbsp;&gt; cp ~/myjavafiles/helloworld.java helloworld.java&lt;/tt&gt;&lt;br/&gt;&lt;tt&gt;&amp;nbsp;&gt; hg add helloworld.java&lt;/tt&gt;
# Commit the file to the local repository.&lt;br/&gt;&lt;tt&gt;&amp;nbsp;&gt; hg commit -m&quot;First commit to bluebird repository&quot; helloworld.java&lt;/tt&gt;
# Pull any changes from the server repository:&lt;br/&gt;&lt;tt&gt;&amp;nbsp;&gt; hg pull &lt;/tt&gt;
# Update the local working copy:&lt;br/&gt;&lt;tt&gt;&amp;nbsp;&gt; hg update&lt;/tt&gt;
# Check the file into your project repository on the server:&lt;br/&gt;&lt;tt&gt;&amp;nbsp;&gt; hg push&lt;/tt&gt;
# When the system accepts your entries, you see the following responses for the initial &lt;tt&gt;helloworld.java&lt;/tt&gt; checkin:&lt;br/&gt;&lt;tt&gt;&amp;nbsp;adding changesets&lt;/tt&gt;&lt;br/&gt;&lt;tt&gt;&amp;nbsp;adding manifests&lt;/tt&gt;&lt;br/&gt;&lt;tt&gt;&amp;nbsp;adding file changes&lt;/tt&gt;&lt;br/&gt;&lt;tt&gt;&amp;nbsp;added 1 changesets with 1 changes to 1 files&lt;/tt&gt;
</text>
  <text-as-html>&lt;p&gt;&lt;a href='&lt;?url_for_page Home?&gt;' class='internal'&gt;&amp;raquo; Project Kenai Documentation and Training&lt;/a&gt; &amp;nbsp;&amp;nbsp; &lt;a href='&lt;?url_for_page Howdoi?&gt;' class='internal'&gt;&amp;raquo; How Do I ...&lt;/a&gt; &amp;nbsp;&amp;nbsp; &lt;a href='&lt;?url_for_page SourceControl?&gt;#About_Mercurial' class='internal'&gt;&amp;raquo; Source Code Management&lt;/a&gt;

&lt;/p&gt;&lt;h2&gt;&lt;a name='Using_Mercurial_on_UNIX_and_Mac_Systems'&gt;&lt;/a&gt;Using Mercurial on UNIX and Mac Systems&lt;/h2&gt;
&lt;p&gt;
Once you have a &lt;a href=&quot;SourceControl#About_Mercurial&quot;&gt;Mercurial client&lt;/a&gt; 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 &lt;a class='external' href=&quot;http://hgbook.red-bean.com/&quot;&gt;http://hgbook.red-bean.com/&lt;/a&gt;. 

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; 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 &lt;a href='&lt;?url_for_page ProfileSettings?&gt;#SSH_Keys' class='internal'&gt;SSH Keys tab&lt;/a&gt; in your user profile. For more information on generating SSH keys, see  &lt;a href='&lt;?url_for_page GeneratingAnSSHKey?&gt;' class='internal'&gt;Generating an SSH Key&lt;/a&gt;.

&lt;/p&gt;&lt;ol&gt;&lt;li&gt; To initially set up your kenai.com repository, you need to know the name of the project and the name of the source repository. For example, for a project named &lt;tt&gt;bluebird&lt;/tt&gt; with a Mercurial repository named &lt;tt&gt;bluebird~mercurial-code-repository&lt;/tt&gt;, the secure read-write URL would be:&lt;br /&gt;&lt;tt&gt; &amp;nbsp;ssh://&lt;i&gt;your-username&lt;/i&gt;@hg.kenai.com/bluebird~mercurial-code-repository&lt;/tt&gt;&lt;/li&gt;&lt;li&gt; Change directories to where you want your new hg repository directory to be created, then do the initial clone and create:&lt;br /&gt;&lt;tt&gt;&amp;nbsp;&amp;gt; cd ~&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;&amp;nbsp;&amp;gt; hg clone ssh://&lt;i&gt;your-username&lt;/i&gt;@hg.kenai.com/bluebird~mercurial-code-repository bluebird-hg&lt;/tt&gt;&lt;/li&gt;&lt;li&gt; Change directories to the new directory:&lt;br /&gt;&lt;tt&gt;&amp;nbsp;&amp;gt; cd bluebird-hg&lt;/tt&gt;&lt;/li&gt;&lt;li&gt; Copy a file to the local working copy and then add it in hg.&lt;br /&gt;&lt;tt&gt;&amp;nbsp;&amp;gt; cp ~/myjavafiles/helloworld.java helloworld.java&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;&amp;nbsp;&amp;gt; hg add helloworld.java&lt;/tt&gt;&lt;/li&gt;&lt;li&gt; Commit the file to the local repository.&lt;br /&gt;&lt;tt&gt;&amp;nbsp;&amp;gt; hg commit -m&amp;quot;First commit to bluebird repository&amp;quot; helloworld.java&lt;/tt&gt;&lt;/li&gt;&lt;li&gt; Pull any changes from the server repository:&lt;br /&gt;&lt;tt&gt;&amp;nbsp;&amp;gt; hg pull &lt;/tt&gt;&lt;/li&gt;&lt;li&gt; Update the local working copy:&lt;br /&gt;&lt;tt&gt;&amp;nbsp;&amp;gt; hg update&lt;/tt&gt;&lt;/li&gt;&lt;li&gt; Check the file into your project repository on the server:&lt;br /&gt;&lt;tt&gt;&amp;nbsp;&amp;gt; hg push&lt;/tt&gt;&lt;/li&gt;&lt;li&gt; When the system accepts your entries, you see the following responses for the initial &lt;tt&gt;helloworld.java&lt;/tt&gt; checkin:&lt;br /&gt;&lt;tt&gt;&amp;nbsp;adding changesets&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;&amp;nbsp;adding manifests&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;&amp;nbsp;adding file changes&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;&amp;nbsp;added 1 changesets with 1 changes to 1 files&lt;/tt&gt;&lt;/li&gt;&lt;/ol&gt;</text-as-html>
  <updated-at type="datetime">2009-06-29T23:38:46Z</updated-at>
  <wiki-id type="integer">34</wiki-id>
</page>
