Skip to main content
This revision made November 07, 2012 23:37, by nvause
« earlier revision revert to this « later revision

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

Using Subversion on Microsoft Windows Systems

Once you have a Subversion client installed on your local system, you can check out code and check it back into your project repository. For full instructions on using Subversion, see http://svnbook.red-bean.com/.

Using HTTPS With Command-Line Subversion

The following instructions for https access using command-line Subversion should get you started.

  1. 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 bluebird that has a repository named subversion, the URL for the repository would look like this:
    https://kenai.com/svn/bluebird~subversion
  2. Change directories to the location on your local machine where the repository will be checked out. For example:
     > cd \myproj
  3. Check out the server repository into a new directory. In the following command, Subversion creates the bluebird-svn directory for you.
     > svn co https://kenai.com/svn/bluebird~subversion bluebird-svn
    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.
  4. Copy a file to the local directory and then add it in subversion.
     > cp helloworld.java bluebird-svn
     > cd bluebird-svn
     > svn add helloworld.java
  5. You see the following acknowledgment, which means that the file has been added and is ready to be checked in:
     A         helloworld.java
  6. Update your local working copy (in case someone has checked files in while you were working):
     > svn update
  7. Check the file into your project repository on the server:
     > svn commit helloworld.java -m"First commit to bluebird repository"
  8. 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.
  9. When the system accepts your entries, you see the following responses for the initial helloworld.java checkin:
     Adding         helloworld.java
     Transmitting file data.
     Committed revision 1.

Using SSH With Command-Line Subversion

This section assumes you have set up an SSH key and you've configured Cygwin to use the key, as described on the following two pages:

The following instructions for SSH access using command-line Subversion should get you started.

  1. 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 bluebird that has a repository named subversion, the URL for the repository would look like this:
    svn+ssh://your-username@svn.kenai.com/bluebird~subversion
  2. Run Cygwin. All the following commands would be entered in the Cygwin shell.
  3. Change directories to the location on your local machine where the repository will be checked out. For example:
     > cd /myproj
  4. Check out the server repository into a new directory. In the following command, Subversion creates the bluebird-svn directory for you.
     > svn co svn+ssh://your-username@svn.kenai.com/bluebird~subversion bluebird-svn
    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.
  5. Copy a file to the local directory and then add it in subversion.
     > cp helloworld.java bluebird-svn
     > cd bluebird-svn
     > svn add helloworld.java
  6. You see the following acknowledgment, which means that the file has been added and is ready to be checked in:
     A         helloworld.java
  7. Update your local working copy (in case someone has checked files in while you were working):
     > svn update
  8. Check the file into your project repository on the server:
     > svn commit helloworld.java -m"First commit to bluebird repository"
  9. When the system accepts your entries, you see the following responses for the initial helloworld.java checkin:
     Adding         helloworld.java
     Transmitting file data.
     Committed revision 1.
Difference compared to previous revision
<span>__TOC__ ===Using HTTPS With Command-Line Subversion=== The following instructions for https access using command-line Subversion should get you started. # 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 ''bluebird'' that has a repository named ''subversion'', the URL for the repository would look like this:<br/><tt><nowiki>https://<span style="text-decoration:line-through;color:red">j</span><span style="text-decoration:underline;color:green">ken</span>a<span style="text-decoration:line-through;color:red">va</span><span style="text-decoration:underline;color:green">i</span>.<span style="text-decoration:line-through;color:red">net</span><span style="text-decoration:underline;color:green">com</span>/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 \myproj</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://<span style="text-decoration:line-through;color:red">j</span><span style="text-decoration:underline;color:green">ken</span>a<span style="text-decoration:line-through;color:red">va</span><span style="text-decoration:underline;color:green">i</span>.<span style="text-decoration:line-through;color:red">net</span><span style="text-decoration:underline;color:green">com</span>/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> #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> ... * [[Winsshwithputty|Generating and Using an SSH Key on a Microsoft Windows Machine]] * [[Usingsvn-winsshsetup|Setting Up Cygwin to Use SSH on a Microsoft Windows Machine]] The following instructions for SSH access using command-line Subversion should get you started. # 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 ''bluebird'' that has a repository named ''subversion'', the URL for the repository would look like this:<br/> <tt><nowiki>svn+ssh://</nowiki></tt>''your-username''<tt>@svn.<span style="text-decoration:line-through;color:red">j</span><span style="text-decoration:underline;color:green">ken</span>a<span style="text-decoration:line-through;color:red">va</span><span style="text-decoration:underline;color:green">i</span>.<span style="text-decoration:line-through;color:red">net</span><span style="text-decoration:underline;color:green">com</span>/bluebird~subversion</tt> # Run Cygwin. All the following commands would be entered in the Cygwin shell. # Change directories to the location on your local machine where the repository will be checked out. For example:<br/><tt>&nbsp;> cd /myproj</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></tt>''your-username''<tt>@svn.<span style="text-decoration:line-through;color:red">j</span><span style="text-decoration:underline;color:green">ken</span>a<span style="text-decoration:line-through;color:red">va</span><span style="text-decoration:underline;color:green">i</span>.<span style="text-decoration:line-through;color:red">net</span><span style="text-decoration:underline;color:green">com</span>/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> #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><span>
 
 
Close
loading
Please Confirm
Close