User Tools

Site Tools


subversion

This is an old revision of the document!


Subversion

*THIS TUTORIAL IS UNDER CONSTRUCTION*

This tutorial is not about using a version control system, or about using Subversion, but about how to get started with Subversion on SDF

There are graphical tools such as TortoiseSVN, but we will start with Subversion's command-line tool (this is SDF we're talking about, right?) which is svn, and is installed on the cluster

Subversion is normally intended to be hosted on a server, so working with it locally with an SDF user account is a little awkward, requiring the use of file: URLs. ===== Creating A Repository ===== To create your own svn repository (place to store projects under source control) run the commands to setup a repository named “my-cool-project” in your homedir under $HOME/.svn_repos. $ mkdir .svn_repos $ svnadmin create .svn_repos/my-cool-project You can then checkout your new repository into a working directory. Make a directory for the working copies of your projects, say: mkdir ~/coding-projects In this local setup where we are using file:// URLS, Subversion requires that you use an absolute path to the repository. To learn the full path to your home directory type: cd; pwd In the rest of this document you will need to replace '/path/to/homedir/' by the output of the previous command, or alternately, the $HOME parameter Then we can (locally) check out our project like so: svn co file:localhost$HOME/.svn_repos/my-cool-project ===== Importing A Directory ===== If you want to add an existing folder to your repository: Let's import our website into our repository! :!: Note that after the import is finished, the original local directory does not become a working copy. To begin working on that data in a versioned fashion, you still need to create a fresh working copy of that tree. cd html svn import -m “initial import” file:localhost$HOME/.svn_repos/my-cool-project/html In this command * 'import' is our 'svn' command * '-m “initial import”' is a message that will appear in the log. * 'file://localhost$HOME/.svn_repos/my-cool-project/html' is the file pointer to our repo, with the last bit being the new directory where we want our 'html' stuff to go You can modify the message, the module name and the tags to your liking, just keep in mind that in the rest of this tutorial we will use 'html' for the module name. ===== 4 Checking It Out ===== cd ~/coding-projects svn co file:localhost$HOME/.svn_repos/my-cool-project/html To verify that you've checked out a working copy of just the html directory, first, do an ls html and see that the files are there. Second, run svn info. It should output something like: <code> $ svn info html Path: html Working Copy Root Path: /sdf/arpa/ns/p/peteyboy/coding-projects/html URL: file:localhost/sdf/arpa/ns/p/peteyboy/.svn_repos/my-cool-project/html Relative URL: ^/html Repository Root: file:localhost/sdf/arpa/ns/p/peteyboy/.svn_repos/my-cool-project Repository UUID: 6909fbfb-0895-7146-9482-bf1fd1033119 Revision: 1 Node Kind: directory Schedule: normal Last Changed Author: peteyboy Last Changed Rev: 1 Last Changed Date: 2021-03-17 20:56:14 +0000 (Wed, 17 Mar 2021) </code> ===== 5 Accessing It Remotely ===== One way to easily set up access to your svn repo for remote use is to set up Trac on SDF

subversion.1616086018.txt.gz · Last modified: 2021/03/18 16:46 by peteyboy