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. [root@server ~]$ SVN_EDITOR='"/bin/vi"'
    [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. rspec svn://
    rspec_on_rails svn://

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

    [root@server ~]$ cd /vendor/plugins
    [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. [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.

Tags: , , , , , , , , ,
One Response to “How to Edit svn:externals from Unix Shell or from TortoiseSVN on Windows”
  1. syntevo says:

    Similar to TortoiseSVN you can add or edit externals using SmartSVN:
    - right click the directory
    - select Externals
    - click Add or Edit
    - enter the “Local Path”
    - right beside the “URL” input field select the periods button to choose the repository location (Repository Browser)
    - if you are using a SVN 1.5 server, you can choose short-hand variants of the selected URL from the combobox
    - to fix the revision, just select the “Revision” radio button, the input field is already prefilled with the latest revision or the revision selected in the Repository Browser
    - finally commit your changes
    - if commit fails, perform an update first, because changing directory properties requires the directory to be at the head revision


Leave a Reply

*Type the letter/number combination in the abvoe field before clicking submit.