How to activate the $Id:$ keyword on files in an existing Subversion repository Apr 27 2006

This is a quick update to my earlier post about using svn keywords:

If you have a Subversion repository already full of files, and you want to activate the $Id:$ keyword on all of them so it expands out to something like:

$Id: index.php 783 2006-04-27 06:05:24Z gserafini $

whenever you check in the file, then use this command:

find . \! -name "*\.svn*" -name "*.php" -exec svn propset svn:keywords "Id" {} \;

This finds all *.php files that are NOT in .svn directories and sets the svn keyword property on each file.

Substitute other filename extensions for the .php that you want to activate the keyword expansion on. Then commit the files and the next time you make a change it will update the $Id:$ tag.

Leave a Reply

sell diamonds