Difference between revisions of "Using SVN from the command-line"
(Created page with "[http://www.example.com link title]==SVN Command Line HOWTO== This document explains the three most important SVN commands that you can use from a command line. It doesn't deal ...") |
|||
Line 1: | Line 1: | ||
==SVN Command Line HOWTO== | |||
This document explains the three most important SVN commands that you can use from a command line. It doesn't deal with questions you may have about how to use TortoiseSVN, ISoft's favorite SVN tool for Windows. | This document explains the three most important SVN commands that you can use from a command line. It doesn't deal with questions you may have about how to use TortoiseSVN, ISoft's favorite SVN tool for Windows. | ||
Line 45: | Line 45: | ||
===Conclusion=== | ===Conclusion=== | ||
These are the three day-to-day operations you will likely want to use from the command line. For more detailed information about using SVN, you | These are the three day-to-day operations you will likely want to use from the command line. For more detailed information about using SVN, you may wish to read [http://svnbook.red-bean.com/en/1.5/index.html Version Control with Subversion]. |
Revision as of 12:47, 3 June 2011
SVN Command Line HOWTO
This document explains the three most important SVN commands that you can use from a command line. It doesn't deal with questions you may have about how to use TortoiseSVN, ISoft's favorite SVN tool for Windows.
Although SVN is a command-line program, it is also context-sensitive. In other words, SVN assumes that you want to operate on files in the current directory, so you should change directories to your "working copy" before getting started.
You can run SVN commands by typing 'svn', followed by the command, followed by the command arguments; for example, if your working copy were stored in /var/www/lx, and you wanted to commit your changes to the repository, you would type:
cd /var/www/lx svn commit
CHECKOUT
Before you can use or work on a product that is stored in SVN, you need to check it out. First, you need an SVN username and password, and you need to know the URL of the files you are checking out. (For example, ITrack products are kept in https://svn.isoftdata.com/ITrack/trunk, LXE is kept in https://svn.isoftdata.com/Web/trunk/EnterpriseLX, etc.
Then, create a folder for your local "working copy" of the product, go to the folder, and enter 'svn checkout' followed by the URL, like this:
svn checkout https://svn.isoftdata.com/Web/trunk/EnterpriseLX
This command will check out all the files needed for running LXE on a given server. (Note that LXE is not ready to use out-of-the-box like this; in order to prepare LXE for actual use follow the steps for Installing LX.)
UPDATE
If you have already checked out files in the past, and you want to update those files based on what is in the SVN repository, you use the 'update' command, like this:
svn update
If there are conflicts between files, you may need to choose between the version of the file that is in the repository ("tc") and the version of the file that is stored in the current directory ("mc"). Otherwise, you may wish to hand-carve the local file based on the differences between it and the one in the repository ("ec"). If you just want to see the differences, type "df" at the question prompt. (For details on the 'diff' command, including how to read its output, enter 'man diff' from a linux prompt.)
COMMIT
You may wish to upload local changes to the repository, creating a new revision that reflects those changes. To do so, you must first ensure that the local copy has been updated (see UPDATE above). Then, commit your changes like this:
svn commit
SVN may ask you to enter some comments in a text editor regarding your changes; you can enter comments or just type :wq to submit your changes without comment.
Conclusion
These are the three day-to-day operations you will likely want to use from the command line. For more detailed information about using SVN, you may wish to read Version Control with Subversion.