Importing into repository¶
Many MAC, Unix, and Linux machines now have subversion pre-installed.
Users of Windows may need to download and install a subversion client (such as TortoiseSVN ). The good news is that some of these clients have context sensitive menus, allowing you to manage your files with a simple right-click.
Adding source code from your computer to the repository¶
- if you have not set up a repository in SeisCode, do so.
- take note of the url, from Settings -> repository
- back up your project before going any further... just in case
- Check out your project.
This tells subversion that one or more of your directories will be associated with your project.
svn co http://seiscode.iris.washington.edu/svn/[project]/trunk [project]/ # svn checkout fromwhere towhere
- add the files to your SeisCode repository using (directories are recursively added)
svn add list_of_files_and_directories
At this point, these files have been marked for addition, but haven't actually been uploaded to SeisCode yet
- Commit files...
svn commit -m "comments for this commit" --username mySeisCodeUsername --password mySeisCodePassword files_and_directories_to_commit
svn commit -F fileContainingCommitComments --username mySeisCodeUsername --password mySeisCodePassword files_and_directories_to_commit
Day-to-day work in your local [project] directory:¶
- Only make changes to this directory using subversion commands. Otherwise, local and SeisCode versions may become out of sync. e.g. :
svn mkdirinstead of
svn rminstead of
svn mvinstead of
svn addto add additional files to your project. Otherwise, they may exist in the directory but will not exist in the repository
svn updateto replace outdated local files with any newer versions that may exist in the repository.
svn statusto compare the local project to the SeisCode Project. Check svn help status for a complete list of codes.
Some common codes include:
?- item is not under version control.
svn committo send any changes to SeisCode's repository.
svn help #provides a list of commands
svn whichcommand -? #provides command-specific help
# example for project named "the-simplest-project" # which was set up using SeisCode for source code management # repository url: http://seiscode.iris.washington.edu/svn/the-simplest-project # # This project consists of 3 files, located at $HOME/simplest/ # files are named prepare.py, calculate.py, and display.py # # for safety sake, our local repository will live in a new directory, $HOME/simpleproject # and the project files will be copied into it before adding them to the repository. # Back up your data. # Note to advanced users: you may wish to create /trunk /branches and /tags within your project first, # and then check out the projectname/trunk instead of just checking out the project root directory. # # Establish the link between SVN and a new directory on your computer svn checkout http://seiscode.iris.washington.edu/svn/the-simplest-project ~/simpleproject cd #go to the $HOME directory # Copy files into the newly created simpleproject directory cp simplest/*.py simpleproject/ cd simpleproject/ # Add these files to your project svn add prepare.py calculate.py display.py #or, to add everything simply "svn add" # Show that these are marked for addition svn status # Commit these files to the repository svn commit -m "initial submission" #commits everything that's changed # Take a look at SeisCode to see what's there