Setting the $Id$ Tag in Subversion

Some excerpts from: Setting the $Id$ Tag in Subversion [StartupCTO]<br />/* * @author David Ordal, david -at- ordal.com * @version $Id$ * */

If you want something like:

<span class="coMULTI">/*
 * @author David Ordal, david -at- ordal.com
 * @version $Id: test.php 110 2009-04-28 05:20:41Z dordal $
 *
 */

</span>

Configure subversion to automatically add the $Id: $ tag

Set your ~/.subversion/config with the following info:

[miscellany]
enable-auto-props = yes

[auto-props]
*.php = svn:keywords=Id
*.js = svn:keywords=Id
<br />

Set props on existing files

That configuration will automatically apply the svn:keywords property (which sets the $Id$ tag) to all new
files. But what about existing files? For these, you’ll have to set the
property manually. Go to the root of your source tree, and run this
command:

find . \( -name “*.php” -o -name “*.js” \) -exec svn propset svn:keywords Id {} \;


Leave a Reply