SVN for Metadata

From NGDC Wiki
Revision as of 12:57, 19 June 2012 by Anna.milan (Talk | contribs)

Jump to: navigation, search

SVN is a subversion directory. It retains all revisions of the metadata XML records and is the interface between the metadata author and published metadata at

Request read/write access from

SVN Clients

  • SVN Client in Oxygen XML Editor
  • Tortoise SVN for windows explorer
  • Linux command line


These are the main functions for working with metadata and SVN.

  1. Checkout a working copy from SVN to your desktop
    • When you check out a 'working copy' it also includes a hidden .svn file which then "knows" the differences between the SVN repository and your desktop copy
  2. Update your working copy
    • You should always update your working copy before you begin editing your metadata - this will ensure that you are editing the latest and greatest from SVN. This is especially important if more than one person is working in the same SVN directory
  3. Commit your changed files to SVN
  4. Add - when you have a new file in your folder then you need to add it to SVN before you commit it.
  5. Status/Synchronize - tells you if there are differences between your local copy and the SVN repository
  6. Delete - you can delete a file from SVN and it will get removed from the current version, previous versions of SVN will still have a copy. After you delete files you must commit the folder.
  7. Rename - you can rename a file in SVN, previous versions in SVN will still have the old name.

Setting Up

Make a local folder or directory and name it something that is meaningful to you, such as SVN_Metadata. This will contain your Working Copy of the metadata files. After you check out files from SVN to this folder - the SVN client know when there are differences between your working copy and the repository copy. It will recognize differences b/t files with the same name and new files in the folder. It will not recognize the difference if you removed a file from your working copy and it will not diff a file that is renamed.

Linux Command Line

After you check out, you must be IN the working copy to perform the other actions

1. Checkout

  • svn co <svnURL>
[amilan@colocolo ~]$ svn co
[amilan@colocolo ~]$ ls
Collection  lion  output  TEST
[amilan@colocolo ~]$ cd Collection/
[amilan@colocolo Collection]$ ls
fgdc  iso  iso_series  iso_u

2. Update

  • svn up
[amilan@colocolo ~]$ cd Collection
[amilan@colocolo Collection]$ svn up
At revision 26469.

3. Commit

  • svn commit
  • you will record commit message in vi
[amilan@colocolo Collection]$ svn commit
Adding         iso_series/reports/temp.html

4. Add

  • svn add fileName
[amilan@colocolo Collection]$ svn add iso_series/reports/temp.html
A         iso_series/reports/temp.html
[amilan@colocolo Collection]$ svn commit

5. Status

  • svn stat
    • question mark means file is not in SVN
[amilan@colocolo Collection]$ svn stat
?       iso_series/reports/temp.html


[amilan@colocolo reports]$ svn delete temp2.html
D         temp2.html
[amilan@colocolo reports]$ svn commit
Deleting       reports/temp2.html

Committed revision 26696.

7. Rename

[amilan@colocolo Collection]$ svn rename iso_series/reports/temp.html iso_series/reports/temp2.html
A         iso_series/reports/temp2.html
D         iso_series/reports/temp.html
[amilan@colocolo Collection]$ svn commit
Deleting       iso_series/reports/temp.html
Adding         iso_series/reports/temp2.html

Committed revision 26695.

Tutorial for SVN Command Line

How to use SVN Client in Oxgyen

Setting Up

  1. Open SVN Client
    Open SVN Client
  2. "Select New Repository Location". See image right.
    Select New Repository Location
    • Add your assigned repository URL
      Add Repository URL
  3. Enter your password to SVN
    • Check "Store Authentication Data" (Then you will never have to set up password again)


  1. Checkout
    • Right click on SVN repository, select 'Check Out'
      Check Out Dialogue Box
    • Set up empty directory on your desktop as the target directory
    • Under Revision, select radio button 'HEAD'
  2. Update
  3. Commit
  4. Add
  5. Status/Synchronize
  6. Delete
  7. Rename

Posting Files to SVN

  1. Outside of SVN client, copy your newly edited files to your working directory
  2. You may need to synchronize
  3. SVN Client will show you what files are different
  4. Commit your files to SVN
    • Only do this when you are confident that your metadata files are valid and ready for the public
    • Right click on directory or set of files, select 'Commit' and enter comments in the dialog box.
      Select commit
    • SVN will record your name and date automatically
      Commit Dialog Box