Difference between revisions of "Svn"
Line 8: | Line 8: | ||
To checkout a working copy of the CSE 473 labs repository on a unix/linux system, type the following within a shell window. (These instructions assume that svn is installed on your computer - if not, you can download it from the subversion web site - http://subversion.apache.org/). | To checkout a working copy of the CSE 473 labs repository on a unix/linux system, type the following within a shell window. (These instructions assume that svn is installed on your computer - if not, you can download it from the subversion web site - http://subversion.apache.org/). | ||
− | svn checkout https:/svn.seas.wustl.edu/repositories/<wustlkey>/ | + | svn checkout https:/svn.seas.wustl.edu/repositories/<wustlkey>/cse473s_fl15/ |
You should substitute your own WUSTL Connect Key login name in place of "yourConnectKey". | You should substitute your own WUSTL Connect Key login name in place of "yourConnectKey". | ||
Line 16: | Line 16: | ||
If you are using TortoiseSvn on a Windows PC, open Windows explorer and create a new folder in an appropriate location (or use an existing folder, if you already have one where you want to download the repository to). Right-click within the empty folder to bring up a "context menu", which should include an SVN checkout menu item. Selecting this will bring up a dialog box in which you can enter the URL for your repository. This takes the form | If you are using TortoiseSvn on a Windows PC, open Windows explorer and create a new folder in an appropriate location (or use an existing folder, if you already have one where you want to download the repository to). Right-click within the empty folder to bring up a "context menu", which should include an SVN checkout menu item. Selecting this will bring up a dialog box in which you can enter the URL for your repository. This takes the form | ||
− | https://svn.seas.wustl.edu/repositories/<wustlkey>/ | + | https://svn.seas.wustl.edu/repositories/<wustlkey>/cse473s_fl15/ |
Proceed as described above. | Proceed as described above. |
Revision as of 21:11, 24 August 2015
(Needs updating for Fall 2015 and new SVN organization being set up by EIT)
An svn repository has been setup for each student on shell.cec.wustl.edu. These will be used in connection with labs and studios, including to submit your lab assignments. SVN is an open-source version control system that allows multiple users working on a common set of files to synchronize through a server (the repository). Repositories can be accessed using any of a number of svn clients. SVN clients come native on most Unix distributions including MAC OSX and Linux. There are also a number of GUI-based SVN clients for Windows, the MAC and Linux. On Windows, TortoiseSvn is a nice client that is available on the Urbauer labs machines.
The first time you use your SVN client to access a repository, you need to first "checkout" a local copy of the repository on your machine.
To checkout a working copy of the CSE 473 labs repository on a unix/linux system, type the following within a shell window. (These instructions assume that svn is installed on your computer - if not, you can download it from the subversion web site - http://subversion.apache.org/).
svn checkout https:/svn.seas.wustl.edu/repositories/<wustlkey>/cse473s_fl15/
You should substitute your own WUSTL Connect Key login name in place of "yourConnectKey".
You will be prompted for a password. Use your Connect Key password. Once you have checked out a copy of your repository, you will see a new directory (folder) with the same name as your repository. Do a cd to this directory and take note of the various files and sub-directories that now appear there.
If you are using TortoiseSvn on a Windows PC, open Windows explorer and create a new folder in an appropriate location (or use an existing folder, if you already have one where you want to download the repository to). Right-click within the empty folder to bring up a "context menu", which should include an SVN checkout menu item. Selecting this will bring up a dialog box in which you can enter the URL for your repository. This takes the form
https://svn.seas.wustl.edu/repositories/<wustlkey>/cse473s_fl15/
Proceed as described above.
There are two basic functions to svn: update and commit, which synchronize your local copy with the repository.
The update command (svn update from command line) downloads into your local copy any file for which the repository has a newer version. If you do not specify an individual file name, it recursively checks for modified files "downward" (in the file system) from where you invoked the command. If you invoke the command at the roor of the repository, it will check for updated files in the entire repository. Asking the repository for an updated copy of an individual file simply requires appending its name after the command, i.e., svn update filename (or selecting if from the GUI menu).
The commit command (svn commit from command line) uploads back to the repository files that you have been modifying. Again, if you do not specify any file name, it recursively uploads any modified versioned file. This allows others to download them (with the update command). Again, you can ask to commit a single file by appending its name after the command i.e., svn commit filename (or selecting if from the GUI menu). Note that when you commit a file, you will usually be asked to enter a short description of the changes you have made. You can bypass this (from command line) using the "-m" option and adding a short blurb of text between quotation marks, i.e., svn commit -m "text" filename (optional).
The other command you will need to use is the add command, svn add, which as its name indicates will identify that a new file needs to be added to the repository, i.e., be versioned. It can be applied to either a directory or a specific file. Many GUIs actually give the option to add an entire new directory and its content in one operation, or for existing directories to check for "unversioned" files, i.e., files that have not yet been added, and select them all.
NOTE: After you have added a file to the repository, you still need to issue a commit command to have it actually uploaded to the repository, i.e., it is a two-step process (again, some client allow you to combine the add and commit operation).