Last updated December 24, 2009 00:15, by Paul
Feedicon  
[[Home|&raquo; Project Kenai Documentation and Training]] &nbsp;&nbsp; [[Howdoi|&raquo; How Do I ...]] &nbsp;&nbsp; [[SourceControl#About_Subversion|&raquo; Source Code Management]] <h2>Using Subversion on UNIX and Mac Systems</h2> Once you have a <a href="SourceControl#About_Subversion">Subversion client</a> installed on your local system, you can check out code and check it back into your project repository. You can use either standard command-line Subversion and https, or you can use SSH for faster and more secure access to the repository. For full instructions on using Subversion, see [http://svnbook.red-bean.com/]. <br/><br/> __TOC__ ===Using HTTPS With Command-Line Subversion=== The following instructions for command-line Subversion should get you started with https access. # To check out the source code for a project, you need to know the name of the project and the name of the source repository. For example, for a project named <tt>bluebird</tt> with a repository named <tt>subversion</tt>, the URL for HTTPS access to the repository would look like this:<br/><tt><nowiki>https://kenai.com/svn/bluebird~subversion</nowiki></tt> # Change directories to the location on your local machine where the repository will be checked out. For example:<br/><tt>&nbsp;> cd ~</tt> # Check out the server repository into a new directory. In the following command, Subversion creates the <tt>bluebird-svn</tt> directory for you. <br/><tt>&nbsp;> svn co <nowiki>https://kenai.com/svn/bluebird~subversion</nowiki> bluebird-svn</tt><br/>'''Note:''' Checking out the source for a project by using a URL like the one above pulls down all the branches and tags, in addition to the trunk code. If there's already code in the repository, you might want to specify a subdirectory to select just the trunk or a branch or tag. # Copy a file to the local directory and then add it in subversion.<br/><tt>&nbsp;> cp helloworld.java bluebird-svn</tt><br/><tt>&nbsp;> cd bluebird-svn</tt><br/><tt>&nbsp;> svn add helloworld.java</tt><br/><br/>You see the following acknowledgment, which means that the file has been added and is ready to be checked in:<br/><tt>&nbsp;A &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;helloworld.java</tt> # Update your local working copy (in case someone has checked files in while you were working):<br/><tt>&nbsp;> svn update</tt> # Check the file into your project repository on the server:<br/><tt>&nbsp;> svn commit helloworld.java -m"First commit to bluebird repository"</tt> # When prompted for your password, enter your project password. If the userid doesn't match your password, you're prompted for the project userid and then the password. # When the system accepts your entries, you see the following responses for the initial <tt>helloworld.java</tt> checkin:<br/><tt>&nbsp;Adding &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;helloworld.java</tt><br/><tt>&nbsp;Transmitting file data.</tt><br/><tt>&nbsp;Committed revision 1.</tt> ===Using SSH With Command-Line Subversion=== #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 check out the source code for a project, you need to know the name of the project and the name of the source repository. For example, for a project named <tt>bluebird</tt> with a repository named <tt>subversion</tt>, the URL for SSH access to the repository would look like this:<br/><tt>&nbsp;<nowiki>svn+ssh://</nowiki>''your-username''@svn.kenai.com/bluebird~subversion</tt> # Change directories to the location on your local machine where the repository will be checked out. For example:<br/><tt>&nbsp;> cd ~</tt> # Check out the server repository into a new directory. In the following command, Subversion creates the <tt>bluebird-svn</tt> directory for you. <br/><tt>&nbsp;> svn co <nowiki>svn+ssh://</nowiki>''your-username''@svn.kenai.com/bluebird~subversion bluebird-svn</tt><br/>'''Note:''' Checking out the source for a project by using a URL like the one above pulls down all the branches and tags, in addition to the trunk code. If there's already code in the repository, you might want to specify a subdirectory to select just the trunk or a branch or tag. # Copy a file to the local directory and then add it in subversion.<br/><tt>&nbsp;> cp helloworld.java bluebird-svn</tt><br/><tt>&nbsp;> cd bluebird-svn</tt><br/><tt>&nbsp;> svn add helloworld.java</tt><br/><br/>You see the following acknowledgment, which means that the file has been added and is ready to be checked in:<br/><tt>&nbsp;A &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;helloworld.java</tt> # Update your local working copy (in case someone has checked files in while you were working):<br/><tt>&nbsp;> svn update</tt> # Check the file into your project repository on the server:<br/><tt>&nbsp;> svn commit helloworld.java -m"First commit to bluebird repository"</tt> # When the system accepts your entries, you see the following responses for the initial <tt>helloworld.java</tt> checkin:<br/><tt>&nbsp;Adding &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;helloworld.java</tt><br/><tt>&nbsp;Transmitting file data.</tt><br/><tt>&nbsp;Committed revision 1.</tt>
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close