Is there some way how to commit into the SVN repository with old time / date or how to edit the time / date post commit?
I have some archived sources which are very old, way before I have started using SVN, and I would now like to put them into the SVN and if possible to preserve their original date, so that SVN history matches the real date where files were edited.
Manipulating SVN server time is an obvious option, but it cannot be used here, as the SVN server is out of my control.
The date and time is in the "special" revision property, svn:date
. You can modify it as so:
svn propedit svn:date --revprop -r 12345
or:
svn propset svn:date --revprop -r 12345 2009-02-12T00:44:04.921324Z
The revision (e.g. 12345
above) can also be HEAD
meaning the latest revision.
The date is specified in ISO 8601 format.
You will need the repository to have the appropriate pre-revprop-change
hook set up (in the hook
directory in the repository) to allow svn:date
to be modified. The templates that are provided with SVN repositories should be helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With