• Home »
  • »
  • How to Edit svn:externals from Unix Shell or from TortoiseSVN on Windows

How to Edit svn:externals from Unix Shell or from TortoiseSVN on Windows

This is a mini how to that shows how to edit svn:externals from a UNIX shell or from TortoiseSVN on Windows. Follow the simple directions below to modify the svn:externals and commit to your SVN repository. I performed the below two sets of steps on CentOS 5.2 for the Linux steps and on Windows XP Service Pack 3 for the Windows steps.

svn:externals from UNIX/Linux shell

  1. Set SVN_EDITOR: First you will need to set the SVN_EDITOR to your favorite UNIX/Linux editor. I perfer vi so following this exact will open the svn:externals in the vi editor. If you want to use a different editory simply change /bin/vi to the path of your favorite editor.
  2. bash

    1. [root@server ~]$ SVN_EDITOR='"/bin/vi"'
    2. [root@server ~]$ export SVN_EDITOR

  3. Edit SVN Externals: Now you will need to edit the existing externals or add new ones using the following command and example file contents below. Make sure to keep in mind the path of the directory you are setting as external. Please note that this is outdated for rspec and currently it is recommended to run the rspec gem instead so this is only being used as an example. So if you wanted to add <svn-root>/vendor/plugins/rspec then you might add the svn:externals to the plugins directory with the below contents:
  4. bash

    1. rspec svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec
    2. rspec_on_rails svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails

    The command to actually edit the externals file for this directory would be the following:


    1. [root@server ~]$ cd /vendor/plugins
    2. [root@server ~]$ svn propedit svn:externals .

    When you are done modifying the file or adding the directories that will sync with external sources then you should write/quit the file from vi with “:wq!”.

  5. Commit Changes: Now run the below command to commit the changes so they can be updated to any servers using this SVN tree.
  6. bash

    1. [root@server ~]$ svn commit -m "updated externals"

svn:externals from TortoiseSVN on Windows

  1. Navigate to Folder: Open up Windows Explorer and navigate to the folder where you will add the svn externals.
  2. Open Folder SVN Properties: Now right click on the folder and select Properties from the drop down. Next click on the SVN tab and then click the Properties button.
  3. Modify or Add SVN Externals: If you already have an SVN:Externals entry you can modify it by double clicking on it.  If you do not have an SVN:Externals entry than click the New button, select SVN:Externals from the drop down, and add the entry. After either action click OK and then click OK again.
  4. Commit Changes: Now right click the folder you just added the SVN Externals to and choose SVN Commit. Enter a message describing your changes and click OK.

Following either of the set of steps above should have updated your svn:externals for that specific folder.