<?xml version="1.0" encoding="UTF-8"?>
<page>
  <created-at type="datetime">2008-06-26T00:17:02Z</created-at>
  <description>Updated ssh URL for subversion</description>
  <id type="integer">4</id>
  <name>SourceControl</name>
  <number type="integer">93</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 ...]]

&lt;h1&gt;Source Code Management&lt;/h1&gt;

When a project administrator chooses a Subversion, Mercurial, or Git repository for your project, as described at [[ManageProject#Source_Code_Repository|Managing a Project: Source Code Repository]], a source code management repository is set up and hosted here that works with this site's Subversion, Mercurial, or Git server software. 

'''''Note:''''' ''If your project uses an external repository, none of the information on this page applies.''

For example, for a project named ''bluebird'' with a subversion repository named ''subversion'', here's the URL for https access:
 &lt;nowiki&gt;https://kenai.com/svn/bluebird~subversion&lt;/nowiki&gt;
Here's the URL for SSH access:
 &lt;tt&gt;&lt;nowiki&gt;svn+ssh://&lt;/nowiki&gt;&lt;/tt&gt;''your-username''&lt;tt&gt;@svn.kenai.com/bluebird~subversion&lt;/tt&gt;


Here's where the read-only Mercurial repository would be:
 &lt;nowiki&gt;https://kenai.com/hg/bluebird~mercurial&lt;/nowiki&gt;
For read/write access to your Mercurial repository, use the Secure Shell Protocol, or SSH, and the ssh prefix. For example:
 &lt;nowiki&gt;ssh://&lt;/nowiki&gt;''your-user-name''&lt;nowiki&gt;@hg.kenai.com/bluebird~mercurial&lt;/nowiki&gt;


Here's where the read-only Git repository would be:
 &lt;nowiki&gt;git://kenai.com/bluebird~git-code-repository&lt;/nowiki&gt;

'''Note:''' The git prefix uses a custom service called ''git-daemon''
to provide read-only public access to repositories. For read/write access, you
must use the Secure Shell Protocol, or SSH, and the ssh prefix. For example&lt;br/&gt;
 &lt;tt&gt;&lt;nowiki&gt;ssh://&lt;/nowiki&gt;''your-user-name''&lt;nowiki&gt;@git.kenai.com/bluebird~git-code-repository&lt;/nowiki&gt;&lt;/tt&gt;

To check files out of and into one of these repositories, you have to install the corresponding client software on your local machine, as described below in [[#overview|Overview: Checking Files Into and Out of a Repository]].

'''Note:''' The project administrator can add more repositories to a project on its Manage page. (On the project's home page, click Manage This Project.) See [[ManageProject#Source_Code_Repository|Managing a Project: Source Code Repository]] for more information.
&lt;br /&gt;

__TOC__

==Viewing Source Repository Information==
To see where your project's source code repository is, open the project page and click the repository link on the left under Source Code Repository.

[[image:selectrepos.png]]

&lt;span id=&quot;overview&quot;&gt;&lt;/span&gt;
==Overview: Checking Files Into and Out of a Repository==

To check files into and out of the repository, you have to download the [[#About_Subversion|Subversion client]], the [[#About_Mercurial|Mercurial client]], or the  [[#About_Git|Git client]] and install it on your local system. 

In general, here's what you do for Subversion to initially get your code into your repository:
# Install the corresponding source code management client on your local system.
# Create a directory on your local machine for the local repository.
# Check out the empty repository from the server to your local repository.
# Add directories and files to the local repository.
# Check the files into your repository on the server.

For Mercurial and Git, the process is a little different:
# Set up an [[GeneratingAnSSHKey|SSH key pair]] and add the public key to your user profile.
# Create a local working repository.
# Add your kenai.com repository as a remote repository, using the ssh syntax.
# In your local working repository, create or import the source code to be checked in.
# Mark the new files to be added.
# Commit the new files to the local repository.
# Push the changes to your kenai.com repository.

After you have some code in the repository, you can use your browser to view the code. See &lt;a href=&quot;#browsing&quot;&gt;Browsing Source Repositories&lt;/a&gt; below for more information.

&lt;span id=&quot;aboutsvn&quot;&gt;&lt;/span&gt; 
==About Subversion==

Subversion is a centralized version control system initially designed to be a suitable replacement for the Concurrent Versions System (CVS). It has long since surpassed CVS in functionality and extensibility. It's available for free either as source code that you compile or as a binary package that's ready to install. See [http://subversion.tigris.org] for more information on getting the Subversion client and installing it on your local system.

&lt;span id=&quot;usingsvn&quot;&gt;&lt;/span&gt;
===Accessing a Subversion Repository===

Once you have Subversion installed on your local system, you can check out code and check it back into your project repository. The following instructions should get you started. 

* [[Usingsvn-unixmac|Using Subversion on UNIX and Mac Systems]]
* [[Usingsvn-win|Using Subversion on Microsoft Windows Systems]]

For full instructions on using Subversion, see [http://svnbook.red-bean.com/]. 

&lt;span id=&quot;abouthg&quot;&gt;&lt;/span&gt; 
==About Mercurial==

Mercurial is a distributed revision control system that is designed to be fast and lightweight. It has a command structure similar to Subversion's. You can download the Mercurial client for installation on your local machine either as a [http://www.selenic.com/mercurial/wiki/index.cgi/BinaryPackages binary package] or as [http://www.selenic.com/mercurial/wiki/index.cgi/Download source code] that you build yourself.

&lt;span id=&quot;usinghg&quot;&gt;&lt;/span&gt;
===Accessing a Mercurial Repository===

Once you have Mercurial installed on your local system, you can check out code and check it back into your project repository.  The following instructions should get you started. 

* [[Usinghg-unixmac|Using Mercurial on UNIX and Mac Systems]]
* [[Usinghg-win|Using Mercurial on Microsoft Windows Systems]]

For full instructions on using Mercurial, see [http://hgbook.red-bean.com/].

&lt;span id=&quot;aboutgit&quot;&gt;&lt;/span&gt; 
==About Git==

Git is a distributed revision control system that was 
originally built for use by the Linux kernel developers. Its feature set is 
similar to that of Mercurial, with the addition of fast local branching.
Like Subversion, it is available as open source for most popular operating 
systems. You can download the Git client at [http://git-scm.com/download].

&lt;span id=&quot;usinggit&quot;&gt;&lt;/span&gt;
===Accessing a Git Repository===

Once you have Git installed on your local system, you can check out code and check it back into your project repository.  The following instructions should get you started. 

# Before you can work with Git, you need to add a public SSH key to your site profile as described in [[GeneratingAnSSHKey|Generating An SSH Key]].
# Open your Kenai project's Git repository page (as described above under [[#Viewing_Source_Repository_Information|Viewing Source Repository Information]]) and copy the SSH URL to your clipboard.
# On your local system, open a terminal window on Linux or Mac or run the Git program on Windows, which opens a Git terminal window for you.
# In your terminal window, run the following series of commands to create a new repository directory, initialize a local repository in that directory, and connect the Kenai server repository to it:&lt;br/&gt;&lt;tt&gt;mkdir new-repo&lt;/tt&gt;&lt;br/&gt;&lt;tt&gt;cd new-repo/&lt;/tt&gt;&lt;br/&gt;&lt;tt&gt;git init&lt;/tt&gt;&lt;br/&gt;&lt;tt&gt;git remote add origin &lt;nowiki&gt;ssh://&lt;/nowiki&gt;''your-user-name''&lt;nowiki&gt;@git.kenai.com/&lt;/nowiki&gt;''your-project-name''&lt;nowiki&gt;~git-code-repository&lt;/nowiki&gt;&lt;/tt&gt;&lt;br/&gt;'''Note:''' You need to paste in your own ssh path to the last command above.

After this series of steps, you can use the local Git repository to check code in and out and push and pull revisions to and from the remote Kenai repository.

For example, you can create a local file called &lt;tt&gt;hello.txt&lt;/tt&gt; and add and commit it to your local repository, then push the changes to your project's Kenai repository by using the following sequence of commands in a terminal or Git window:

 $ git add hello.txt
 $ git commit hello.txt -m&quot;First commit of new file hello.txt&quot;
 $ git push origin master

After a successful push, the changes are reflected in the source code browser for your project on Kenai.com. Any other clones of the repository will be able to see them as well after you &lt;tt&gt;git&lt;/tt&gt; &lt;tt&gt;pull&lt;/tt&gt; the latest revision.

&lt;span id=&quot;browsing&quot;&gt;&lt;/span&gt;
==Browsing Source Repositories==

Project Kenai not only enables you to do source code management, but lets you browse your repositories with your web browser. To browse a project's repository, you first display the project page, then click Get Source Code and click Browse in the popup, as shown below.

'''Note:''' You can limit who can browse your source code by setting role permissions for the ''Check Out'' action. For more information, see [[ManageProject#Source_Code_Repository|Managing a Project: Source Code Repository]].

[[image:browsecoderepos.png]]

{|-
|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br/&gt;
|'''Note:''' ''If you see a screen like the following one, the repository is empty. Follow the instructions [[#overview|above]] for your type of source control management system to add files to the repository.''&lt;br/&gt;&lt;br/&gt;
[[image:browserepos-nofiles.png]]
|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
|}

After clicking Browse, you see a list of the project's repository's files and folders. Click files to see them or click folders to open them. You can use the dark blue path (below the light blue area that shows the revision number) to keep track of where you are in the tree. You can click any folder in that path to navigate back up the tree. 

For example, the following screen shot shows the createPkg1.html file open in the sourceUI folder. The path is above ''File Revision History''. 

[[image:browserepos-viewfile.png]]

With a file displayed, here are some of the things you can do:

&lt;span id=&quot;revisionnum&quot;&gt;&lt;/span&gt; 
===Determining the File Revision Number===
You see the revision number at the top left of the light blue region. In the image above, the revision number is 34.

&lt;span id=&quot;filerevision&quot;&gt;&lt;/span&gt; 
===Seeing File Revision History===
Click ''File Revision History'' on the left under the path and above the file size. (See above figure.)

&lt;span id=&quot;getfile&quot;&gt;&lt;/span&gt; 
===Getting a Copy of the File===
To get a copy of the file that you can save on your local machine:
# Click ''Get Raw File'' to the right of ''File Revision History''.  (See above figure.)
# In the browser dialog box, save the file.

&lt;span id=&quot;diff&quot;&gt;&lt;/span&gt; 
===Viewing Diffs of Two File Revisions===

A ''diff'' is a view of both files showing the changes (differences).

To see a diff between two revisions:
# Display the file and click ''File Revision History'' to determine which revisions you want to see.&lt;br/&gt;[[image:browserepos-filerev.png]]
# Click the browser's Back button to go back to the previous screen that shows the file.
# In the fields to the right of the ''Get diffs'' button, enter the two revision numbers you want to compare, then click ''Get diffs'', as shown in the figure below.&lt;br/&gt;[[image:browserepos-getdiffs.png]]

&lt;span id=&quot;projectrevision&quot;&gt;&lt;/span&gt; 
===Seeing Project Revision History===
Click ''Project Revision History'' in the top right part of the blue area. (See above figure.)

&lt;span id=&quot;checkouturl&quot;&gt;&lt;/span&gt; 
===Getting a File's Checkout URL===
# Click ''Checkout URL'' in the right part of the blue area under Project Revision History.
# Select and copy the URL from the popup and use it in your source control client, as shown in the following figure.&lt;br/&gt;[[image:browserepos-checkouturl.png]]</text>
  <text-as-html>&lt;p&gt;&lt;a href='&lt;?url_for_page Home ?&gt;' class='&lt;?class_for_page_link Home ?&gt;'&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='&lt;?class_for_page_link Howdoi ?&gt;'&gt; &amp;raquo; How Do I ...&lt;/a&gt;

&lt;/p&gt;&lt;p&gt;&lt;h1&gt;Source Code Management&lt;/h1&gt;

&lt;/p&gt;&lt;p&gt;When a project administrator chooses a Subversion, Mercurial, or Git repository for your project, as described at &lt;a href='&lt;?url_for_page ManageProject?&gt;#Source_Code_Repository' class='&lt;?class_for_page_link ManageProject?&gt;'&gt;Managing a Project: Source Code Repository&lt;/a&gt;, a source code management repository is set up and hosted here that works with this site's Subversion, Mercurial, or Git server software. 

&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;/i&gt; &lt;i&gt;If your project uses an external repository, none of the information on this page applies.&lt;/i&gt;

&lt;/p&gt;&lt;p&gt;For example, for a project named &lt;i&gt;bluebird&lt;/i&gt; with a subversion repository named &lt;i&gt;subversion&lt;/i&gt;, here's the URL for https access:
&lt;/p&gt;&lt;pre&gt; https://kenai.com/svn/bluebird~subversion
&lt;/pre&gt;&lt;p&gt;Here's the URL for SSH access:
&lt;/p&gt;&lt;pre&gt; &lt;tt&gt;svn+ssh://&lt;/tt&gt;&lt;i&gt;your-username&lt;/i&gt;&lt;tt&gt;@svn.kenai.com/bluebird~subversion&lt;/tt&gt;
&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;

&lt;/p&gt;&lt;p&gt;Here's where the read-only Mercurial repository would be:
&lt;/p&gt;&lt;pre&gt; https://kenai.com/hg/bluebird~mercurial
&lt;/pre&gt;&lt;p&gt;For read/write access to your Mercurial repository, use the Secure Shell Protocol, or SSH, and the ssh prefix. For example:
&lt;/p&gt;&lt;pre&gt; ssh://&lt;i&gt;your-user-name&lt;/i&gt;@hg.kenai.com/bluebird~mercurial
&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;

&lt;/p&gt;&lt;p&gt;Here's where the read-only Git repository would be:
&lt;/p&gt;&lt;pre&gt; git://kenai.com/bluebird~git-code-repository
&lt;/pre&gt;&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; The git prefix uses a custom service called &lt;i&gt;git-daemon&lt;/i&gt;
to provide read-only public access to repositories. For read/write access, you
must use the Secure Shell Protocol, or SSH, and the ssh prefix. For example&lt;br /&gt;&lt;/p&gt;&lt;pre&gt; &lt;tt&gt;ssh://&lt;i&gt;your-user-name&lt;/i&gt;@git.kenai.com/bluebird~git-code-repository&lt;/tt&gt;
&lt;/pre&gt;&lt;p&gt;
To check files out of and into one of these repositories, you have to install the corresponding client software on your local machine, as described below in &lt;a href='#overview' class='internal'&gt;Overview: Checking Files Into and Out of a Repository&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; The project administrator can add more repositories to a project on its Manage page. (On the project's home page, click Manage This Project.) See &lt;a href='&lt;?url_for_page ManageProject?&gt;#Source_Code_Repository' class='&lt;?class_for_page_link ManageProject?&gt;'&gt;Managing a Project: Source Code Repository&lt;/a&gt; for more information.
&lt;br /&gt;

&lt;/p&gt;&lt;div id='toc' class='toc'&gt;
           &lt;div id='toctitle' class='toc-title'&gt;
             &lt;span&gt;Contents&lt;/span&gt;
           &lt;/div&gt;
           &lt;div id='toccontents' class='toc-contents'&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;1 &lt;a href='#Viewing_Source_Repository_Information'&gt;Viewing Source Repository Information&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2 &lt;a href='#Overview:_Checking_Files_Into_and_Out_of_a_Repository'&gt;Overview: Checking Files Into and Out of a Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;3 &lt;a href='#About_Subversion'&gt;About Subversion&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;3.1 &lt;a href='#Accessing_a_Subversion_Repository'&gt;Accessing a Subversion Repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;4 &lt;a href='#About_Mercurial'&gt;About Mercurial&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;4.1 &lt;a href='#Accessing_a_Mercurial_Repository'&gt;Accessing a Mercurial Repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;5 &lt;a href='#About_Git'&gt;About Git&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;5.1 &lt;a href='#Accessing_a_Git_Repository'&gt;Accessing a Git Repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;6 &lt;a href='#Browsing_Source_Repositories'&gt;Browsing Source Repositories&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;6.1 &lt;a href='#Determining_the_File_Revision_Number'&gt;Determining the File Revision Number&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;6.2 &lt;a href='#Seeing_File_Revision_History'&gt;Seeing File Revision History&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;6.3 &lt;a href='#Getting_a_Copy_of_the_File'&gt;Getting a Copy of the File&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;6.4 &lt;a href='#Viewing_Diffs_of_Two_File_Revisions'&gt;Viewing Diffs of Two File Revisions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;6.5 &lt;a href='#Seeing_Project_Revision_History'&gt;Seeing Project Revision History&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;6.6 &lt;a href='#Getting_a_File_s_Checkout_URL'&gt;Getting a File's Checkout URL&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/div&gt;
         &lt;/div&gt;&lt;p&gt;&lt;br /&gt;

&lt;/p&gt;&lt;h2&gt;&lt;a name='Viewing_Source_Repository_Information'&gt;&lt;/a&gt;Viewing Source Repository Information&lt;/h2&gt;
&lt;p&gt;To see where your project's source code repository is, open the project page and click the repository link on the left under Source Code Repository.

&lt;/p&gt;&lt;p&gt;&lt;?link_for_image selectrepos.png?&gt;

&lt;/p&gt;&lt;p&gt;&lt;span id=&quot;overview&quot; /&gt;&lt;/p&gt;&lt;h2&gt;&lt;a name='Overview:_Checking_Files_Into_and_Out_of_a_Repository'&gt;&lt;/a&gt;Overview: Checking Files Into and Out of a Repository&lt;/h2&gt;
&lt;p&gt;
To check files into and out of the repository, you have to download the &lt;a href='#About_Subversion' class='internal'&gt;Subversion client&lt;/a&gt;, the &lt;a href='#About_Mercurial' class='internal'&gt;Mercurial client&lt;/a&gt;, or the  &lt;a href='#About_Git' class='internal'&gt;Git client&lt;/a&gt; and install it on your local system. 

&lt;/p&gt;&lt;p&gt;In general, here's what you do for Subversion to initially get your code into your repository:
&lt;/p&gt;&lt;ol&gt;&lt;li&gt; Install the corresponding source code management client on your local system.
&lt;/li&gt;&lt;li&gt; Create a directory on your local machine for the local repository.
&lt;/li&gt;&lt;li&gt; Check out the empty repository from the server to your local repository.
&lt;/li&gt;&lt;li&gt; Add directories and files to the local repository.
&lt;/li&gt;&lt;li&gt; Check the files into your repository on the server.
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
For Mercurial and Git, the process is a little different:
&lt;/p&gt;&lt;ol&gt;&lt;li&gt; Set up an &lt;a href='&lt;?url_for_page GeneratingAnSSHKey?&gt;' class='&lt;?class_for_page_link GeneratingAnSSHKey?&gt;'&gt;SSH key pair&lt;/a&gt; and add the public key to your user profile.
&lt;/li&gt;&lt;li&gt; Create a local working repository.
&lt;/li&gt;&lt;li&gt; Add your kenai.com repository as a remote repository, using the ssh syntax.
&lt;/li&gt;&lt;li&gt; In your local working repository, create or import the source code to be checked in.
&lt;/li&gt;&lt;li&gt; Mark the new files to be added.
&lt;/li&gt;&lt;li&gt; Commit the new files to the local repository.
&lt;/li&gt;&lt;li&gt; Push the changes to your kenai.com repository.
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
After you have some code in the repository, you can use your browser to view the code. See &lt;a href=&quot;#browsing&quot;&gt;Browsing Source Repositories&lt;/a&gt; below for more information.

&lt;/p&gt;&lt;p&gt;&lt;span id=&quot;aboutsvn&quot; /&gt; 
&lt;/p&gt;&lt;h2&gt;&lt;a name='About_Subversion'&gt;&lt;/a&gt;About Subversion&lt;/h2&gt;
&lt;p&gt;
Subversion is a centralized version control system initially designed to be a suitable replacement for the Concurrent Versions System (CVS). It has long since surpassed CVS in functionality and extensibility. It's available for free either as source code that you compile or as a binary package that's ready to install. See &lt;a class='external' href=&quot;http://subversion.tigris.org&quot;&gt;http://subversion.tigris.org&lt;/a&gt; for more information on getting the Subversion client and installing it on your local system.

&lt;/p&gt;&lt;p&gt;&lt;span id=&quot;usingsvn&quot; /&gt;&lt;/p&gt;&lt;h3&gt;&lt;a name='Accessing_a_Subversion_Repository'&gt;&lt;/a&gt;Accessing a Subversion Repository&lt;/h3&gt;
&lt;p&gt;
Once you have Subversion installed on your local system, you can check out code and check it back into your project repository. The following instructions should get you started. 

&lt;/p&gt;&lt;ul&gt;&lt;li&gt; &lt;a href='&lt;?url_for_page Usingsvn-unixmac?&gt;' class='&lt;?class_for_page_link Usingsvn-unixmac?&gt;'&gt;Using Subversion on UNIX and Mac Systems&lt;/a&gt;&lt;/li&gt;&lt;li&gt; &lt;a href='&lt;?url_for_page Usingsvn-win?&gt;' class='&lt;?class_for_page_link Usingsvn-win?&gt;'&gt;Using Subversion on Microsoft Windows Systems&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
For full instructions on using Subversion, see &lt;a class='external' href=&quot;http://svnbook.red-bean.com/&quot;&gt;http://svnbook.red-bean.com/&lt;/a&gt;. 

&lt;/p&gt;&lt;p&gt;&lt;span id=&quot;abouthg&quot; /&gt; 
&lt;/p&gt;&lt;h2&gt;&lt;a name='About_Mercurial'&gt;&lt;/a&gt;About Mercurial&lt;/h2&gt;
&lt;p&gt;
Mercurial is a distributed revision control system that is designed to be fast and lightweight. It has a command structure similar to Subversion's. You can download the Mercurial client for installation on your local machine either as a &lt;a class='external' href=&quot;http://www.selenic.com/mercurial/wiki/index.cgi/BinaryPackages&quot;&gt;binary package&lt;/a&gt; or as &lt;a class='external' href=&quot;http://www.selenic.com/mercurial/wiki/index.cgi/Download&quot;&gt;source code&lt;/a&gt; that you build yourself.

&lt;/p&gt;&lt;p&gt;&lt;span id=&quot;usinghg&quot; /&gt;&lt;/p&gt;&lt;h3&gt;&lt;a name='Accessing_a_Mercurial_Repository'&gt;&lt;/a&gt;Accessing a Mercurial Repository&lt;/h3&gt;
&lt;p&gt;
Once you have Mercurial installed on your local system, you can check out code and check it back into your project repository.  The following instructions should get you started. 

&lt;/p&gt;&lt;ul&gt;&lt;li&gt; &lt;a href='&lt;?url_for_page Usinghg-unixmac?&gt;' class='&lt;?class_for_page_link Usinghg-unixmac?&gt;'&gt;Using Mercurial on UNIX and Mac Systems&lt;/a&gt;&lt;/li&gt;&lt;li&gt; &lt;a href='&lt;?url_for_page Usinghg-win?&gt;' class='&lt;?class_for_page_link Usinghg-win?&gt;'&gt;Using Mercurial on Microsoft Windows Systems&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
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;span id=&quot;aboutgit&quot; /&gt; 
&lt;/p&gt;&lt;h2&gt;&lt;a name='About_Git'&gt;&lt;/a&gt;About Git&lt;/h2&gt;
&lt;p&gt;
Git is a distributed revision control system that was 
originally built for use by the Linux kernel developers. Its feature set is 
similar to that of Mercurial, with the addition of fast local branching.
Like Subversion, it is available as open source for most popular operating 
systems. You can download the Git client at &lt;a class='external' href=&quot;http://git-scm.com/download&quot;&gt;http://git-scm.com/download&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;&lt;span id=&quot;usinggit&quot; /&gt;&lt;/p&gt;&lt;h3&gt;&lt;a name='Accessing_a_Git_Repository'&gt;&lt;/a&gt;Accessing a Git Repository&lt;/h3&gt;
&lt;p&gt;
Once you have Git installed on your local system, you can check out code and check it back into your project repository.  The following instructions should get you started. 

&lt;/p&gt;&lt;ol&gt;&lt;li&gt; Before you can work with Git, you need to add a public SSH key to your site profile as described in &lt;a href='&lt;?url_for_page GeneratingAnSSHKey?&gt;' class='&lt;?class_for_page_link GeneratingAnSSHKey?&gt;'&gt;Generating An SSH Key&lt;/a&gt;.
&lt;/li&gt;&lt;li&gt; Open your Kenai project's Git repository page (as described above under &lt;a href='#Viewing_Source_Repository_Information' class='internal'&gt;Viewing Source Repository Information&lt;/a&gt;) and copy the SSH URL to your clipboard.
&lt;/li&gt;&lt;li&gt; On your local system, open a terminal window on Linux or Mac or run the Git program on Windows, which opens a Git terminal window for you.
&lt;/li&gt;&lt;li&gt; In your terminal window, run the following series of commands to create a new repository directory, initialize a local repository in that directory, and connect the Kenai server repository to it:&lt;br /&gt;&lt;tt&gt;mkdir new-repo&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;cd new-repo/&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;git init&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;git remote add origin ssh://&lt;i&gt;your-user-name&lt;/i&gt;@git.kenai.com/&lt;i&gt;your-project-name&lt;/i&gt;~git-code-repository&lt;/tt&gt;&lt;br /&gt;&lt;b&gt;Note:&lt;/b&gt; You need to paste in your own ssh path to the last command above.
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
After this series of steps, you can use the local Git repository to check code in and out and push and pull revisions to and from the remote Kenai repository.

&lt;/p&gt;&lt;p&gt;For example, you can create a local file called &lt;tt&gt;hello.txt&lt;/tt&gt; and add and commit it to your local repository, then push the changes to your project's Kenai repository by using the following sequence of commands in a terminal or Git window:

&lt;/p&gt;&lt;pre&gt; $ git add hello.txt
 $ git commit hello.txt -m&amp;quot;First commit of new file hello.txt&amp;quot;
 $ git push origin master
&lt;/pre&gt;&lt;p&gt;
After a successful push, the changes are reflected in the source code browser for your project on Kenai.com. Any other clones of the repository will be able to see them as well after you &lt;tt&gt;git&lt;/tt&gt; &lt;tt&gt;pull&lt;/tt&gt; the latest revision.

&lt;/p&gt;&lt;p&gt;&lt;span id=&quot;browsing&quot; /&gt;&lt;/p&gt;&lt;h2&gt;&lt;a name='Browsing_Source_Repositories'&gt;&lt;/a&gt;Browsing Source Repositories&lt;/h2&gt;
&lt;p&gt;
Project Kenai not only enables you to do source code management, but lets you browse your repositories with your web browser. To browse a project's repository, you first display the project page, then click Get Source Code and click Browse in the popup, as shown below.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; You can limit who can browse your source code by setting role permissions for the &lt;i&gt;Check Out&lt;/i&gt; action. For more information, see &lt;a href='&lt;?url_for_page ManageProject?&gt;#Source_Code_Repository' class='&lt;?class_for_page_link ManageProject?&gt;'&gt;Managing a Project: Source Code Repository&lt;/a&gt;.

&lt;/p&gt;&lt;p&gt;&lt;?link_for_image browsecoderepos.png?&gt;

&lt;/p&gt;&lt;div style=&quot;overflow-x: auto;&quot;&gt;&lt;div style=&quot;margin: 0px 2px 0px 2px;&quot;&gt;
&lt;table -&gt;&lt;tr&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Note:&lt;/b&gt; &lt;i&gt;If you see a screen like the following one, the repository is empty. Follow the instructions &lt;a href='#overview' class='internal'&gt;above&lt;/a&gt; for your type of source control management system to add files to the repository.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;?link_for_image browserepos-nofiles.png?&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;
After clicking Browse, you see a list of the project's repository's files and folders. Click files to see them or click folders to open them. You can use the dark blue path (below the light blue area that shows the revision number) to keep track of where you are in the tree. You can click any folder in that path to navigate back up the tree. 

&lt;/p&gt;&lt;p&gt;For example, the following screen shot shows the createPkg1.html file open in the sourceUI folder. The path is above &lt;i&gt;File Revision History&lt;/i&gt;. 

&lt;/p&gt;&lt;p&gt;&lt;?link_for_image browserepos-viewfile.png?&gt;

&lt;/p&gt;&lt;p&gt;With a file displayed, here are some of the things you can do:

&lt;/p&gt;&lt;p&gt;&lt;span id=&quot;revisionnum&quot; /&gt; 
&lt;/p&gt;&lt;h3&gt;&lt;a name='Determining_the_File_Revision_Number'&gt;&lt;/a&gt;Determining the File Revision Number&lt;/h3&gt;
&lt;p&gt;You see the revision number at the top left of the light blue region. In the image above, the revision number is 34.

&lt;/p&gt;&lt;p&gt;&lt;span id=&quot;filerevision&quot; /&gt; 
&lt;/p&gt;&lt;h3&gt;&lt;a name='Seeing_File_Revision_History'&gt;&lt;/a&gt;Seeing File Revision History&lt;/h3&gt;
&lt;p&gt;Click &lt;i&gt;File Revision History&lt;/i&gt; on the left under the path and above the file size. (See above figure.)

&lt;/p&gt;&lt;p&gt;&lt;span id=&quot;getfile&quot; /&gt; 
&lt;/p&gt;&lt;h3&gt;&lt;a name='Getting_a_Copy_of_the_File'&gt;&lt;/a&gt;Getting a Copy of the File&lt;/h3&gt;
&lt;p&gt;To get a copy of the file that you can save on your local machine:
&lt;/p&gt;&lt;ol&gt;&lt;li&gt; Click &lt;i&gt;Get Raw File&lt;/i&gt; to the right of &lt;i&gt;File Revision History&lt;/i&gt;.  (See above figure.)
&lt;/li&gt;&lt;li&gt; In the browser dialog box, save the file.
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span id=&quot;diff&quot; /&gt; 
&lt;/p&gt;&lt;h3&gt;&lt;a name='Viewing_Diffs_of_Two_File_Revisions'&gt;&lt;/a&gt;Viewing Diffs of Two File Revisions&lt;/h3&gt;
&lt;p&gt;
A &lt;i&gt;diff&lt;/i&gt; is a view of both files showing the changes (differences).

&lt;/p&gt;&lt;p&gt;To see a diff between two revisions:
&lt;/p&gt;&lt;ol&gt;&lt;li&gt; Display the file and click &lt;i&gt;File Revision History&lt;/i&gt; to determine which revisions you want to see.&lt;br /&gt;&lt;?link_for_image browserepos-filerev.png?&gt;&lt;/li&gt;&lt;li&gt; Click the browser's Back button to go back to the previous screen that shows the file.
&lt;/li&gt;&lt;li&gt; In the fields to the right of the &lt;i&gt;Get diffs&lt;/i&gt; button, enter the two revision numbers you want to compare, then click &lt;i&gt;Get diffs&lt;/i&gt;, as shown in the figure below.&lt;br /&gt;&lt;?link_for_image browserepos-getdiffs.png?&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span id=&quot;projectrevision&quot; /&gt; 
&lt;/p&gt;&lt;h3&gt;&lt;a name='Seeing_Project_Revision_History'&gt;&lt;/a&gt;Seeing Project Revision History&lt;/h3&gt;
&lt;p&gt;Click &lt;i&gt;Project Revision History&lt;/i&gt; in the top right part of the blue area. (See above figure.)

&lt;/p&gt;&lt;p&gt;&lt;span id=&quot;checkouturl&quot; /&gt; 
&lt;/p&gt;&lt;h3&gt;&lt;a name='Getting_a_File_s_Checkout_URL'&gt;&lt;/a&gt;Getting a File's Checkout URL&lt;/h3&gt;
&lt;ol&gt;&lt;li&gt; Click &lt;i&gt;Checkout URL&lt;/i&gt; in the right part of the blue area under Project Revision History.
&lt;/li&gt;&lt;li&gt; Select and copy the URL from the popup and use it in your source control client, as shown in the following figure.&lt;br /&gt;&lt;?link_for_image browserepos-checkouturl.png?&gt;&lt;/li&gt;&lt;/ol&gt;</text-as-html>
  <updated-at type="datetime">2009-12-24T00:35:31Z</updated-at>
  <wiki-id type="integer">34</wiki-id>
</page>
