Using Subversion for GPSTk development

What is Subversion?

Subversion is a revision control system. It records all the source code, and tracks changes to that source code.

It can be downloaded from A Windows shell extension client is available at, and a cross-platform GUI at There is also a book about Subversion usage online at

See Installing Subversion Client

How does GPSTk use Subversion?

The GPSTk project uses the subversion service at to store and track changes to the source code. You don't have to use subversion to contribute to GPSTk, but it is the most convenient method if you are doing more than a one-off patch. You can also browse the subversion repository using viewvc:

File Properties

Subversion supports meta data about files in the form of properties. There are several of the standard subversion (svn:) properties used in the GPSTk.
keyword value comments
svn:keywords Id Set this on all source files and place the string "$Id$" at an appropriate place in the source code. In C++ this is often done as: #pragma ident "$Id$"
svn:eol-style native Set this on all text files so the end of line works correctly on both windows and unix platforms.
svn:ignore targets Set this on each directory that has build targets that won't be controlled by subversion.


To make every c++ file in the current directory have the needed properties:
$svn propset svn:eol-style native *pp
$svn propset svn:keywords Id *pp
In the dev/apps/reszilla directory there are several targets that are built: ordGen,ordEdit,ordClock,ordLinEst,ordStats,ddGen, and ddStats. To make all of these not appear in the svn status command, add them to the svn:ignore property for that directory:
$ svn propset svn:ignore "ordGen
ddGen" dev/apps/reszilla
Note that the enter key is pressed after each pattern so they are separated by newlines. There may be a better/easier way to do this but I haven't taken the time to find it.

Subversion Client Defaults

To make the eol-style and keywords properties set by default, add(or uncomment) the following lines in your local subversion config file (~/.subversion/config under unix):
*.c = svn:eol-style=native;svn:keywords=Id
*.cpp = svn:eol-style=native;svn:keywords=Id
*.h = svn:eol-style=native;svn:keywords=Id
*.sh = svn:eol-style=native;svn:executable;svn:keywords=Id
*.txt = svn:eol-style=native;svn:keywords=Id
Makefile = svn:eol-style=native;svn:keywords=Id
Jamfile = svn:eol-style=native;svn:keywords=Id


Check-ins are automatically mailed to the gpstk-subversion mailing list. See GPSTkEmailLists.

Mini-Guide to Using Subversion with Command-Line Tools

Here are two documents describing, first, what is SourceForge, and, second, how to use their Subversion service:

To get an anonymous copy of the development version of the GPSTk, use this command:

svn checkout

This creates a directory tree "gpstk" in the current directory and populates it with the GPSTk source.

To check in source you need to have a SourceForge developer account, and that account needs to be listed as a developer account under the GPSTk project. To check in code in the current working directory, or a subdirectory, use this command.

svn commit [--message "Comments"]

If you do not supply a text editor will be lauched wherin you must provide some textual comments. You have to explicitly specify that developer account on checkin if that developer account name is not the same as the username in your current environment. For example:

svn --username pben commit -m "First checkin."

Basic commands

Task Command Notes
Get a copy of the repository svn checkout *The tree is writeable.
Update your repository
svn update
Conflicts are noted, and files in conflict are modified with markers.
List your changes prior to commiting them svn status  
Abandon changes or adds svn revert [file]  
Commit your changes svn commit [optional -m "Mandatory log message"] If you don't supply a log message it will launch a text editor for you to enter one in. Which editor is launched can be redefined by setting the EDITOR environment variable.
Apologize to subversion about the conflict sv resolved [file in conflict] Do this after you have edited the conflicting file.
Recursively add a directory svn add [dir]  
Get help all commands svn help  
Get help on a command svn help [command]  

-- BenHarris - 26 Oct 2006


Topic revision: r7 - 09 Sep 2010, YanWei

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback