» Project Kenai Documentation and Training » How Do I ...
When a project administrator chooses a Subversion, Mercurial, or Git repository for your project, as described at 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:
https://kenai.com/svn/bluebird~subversion
Here's the URL for SSH access:
svn+ssh://your-username@svn.kenai.com/bluebird~subversion
Here's where the read-only Mercurial repository would be:
https://kenai.com/hg/bluebird~mercurial
For read/write access to your Mercurial repository, use the Secure Shell Protocol, or SSH, and the ssh prefix. For example:
ssh://your-user-name@hg.kenai.com/bluebird~mercurial
Here's where the read-only Git repository would be:
git://kenai.com/bluebird~git-code-repository
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
ssh://your-user-name@git.kenai.com/bluebird~git-code-repository
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: 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 Managing a Project: Source Code Repository for more 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.
To check files into and out of the repository, you have to download the Subversion client, the Mercurial client, or the 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:
For Mercurial and Git, the process is a little different:
After you have some code in the repository, you can use your browser to view the code. See Browsing Source Repositories below for more information.
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.
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.
For full instructions on using Subversion, see http://svnbook.red-bean.com/.
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 binary package or as source code that you build yourself.
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.
For full instructions on using Mercurial, see http://hgbook.red-bean.com/.
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.
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.
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 hello.txt 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"First commit of new file hello.txt" $ 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 git pull the latest revision.
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 Managing a Project: Source Code Repository.
| Note: If you see a screen like the following one, the repository is empty. Follow the instructions above for your type of source control management system to add files to the repository.![]() |
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.
With a file displayed, here are some of the things you can do:
You see the revision number at the top left of the light blue region. In the image above, the revision number is 34.
Click File Revision History on the left under the path and above the file size. (See above figure.)
To get a copy of the file that you can save on your local machine:
A diff is a view of both files showing the changes (differences).
To see a diff between two revisions:
Click Project Revision History in the top right part of the blue area. (See above figure.)