Computer Laboratory

Making Changes

For more details on using Subversion visit the Subversion online instruction book


Change commands

The Basic Usage section of the Subversion guide provides further information about making changes to files.

To make changes to a file, you would use the following choice of commands:
  • svn add

    - svn add fileA
    When you next Commit, "fileA" will become a child of its parent directory.
    - svn add directoryA
    When you next commit, "directoryA" will be added to the repository. If it contains sub files and folders, they too, will be added.
    - svn add -N directoryA
    The -N switch will add "directoryA" only.
    This is the recommended use of svn add as generally the only files which need adding under a directory are the *-b.html, *.pdf and any image files.

  • svn delete

    - svn delete fileA
    - svn delete directoryA
    This schedules a file or directory for deletion from the repository.
    If it is a file, it is deleted immediately from the working copy.
    If it is a directory, it is not deleted, but Subversion schedules it for deletion.
    When you commit your changes, then the directory will be deleted from your working copy and the directory.

  • svn copy

    - svn copy fileA fileB
    Creates new item "fileB" as a copy of "fileA" and automatically schedules the new file for addition.

  • svn move

    - svn move fileA fileB
    This is the same as running:
    svn copy fileA fileB followed by svn delete fileA
    I.e. "fileB" is scheduled for addition as a copy of "fileA", and "fileA" is scheduled for removal.

  • svn mkdir

    - svn mkdir newDir
    This makes a new directory and then schedules for addition to the repository at next commit.
Note:
Examining changes
Before you commit your changes to the repository, it is a good idea to take a look at the changes you have made before committing them. This will:
  • Help you make accurate log messages
  • Check for changes you may have made by mistake and revert back before committing
  • Scrutinise your changes for errors before publishing
You can see an overview of changes you have made using the command: svn status
You can view the details of these changes using the command: svn diff