How can I force subversion to commit an unchanged file?
I want subversion to commit a file even if it's unchanged. Is there a way to do this?
If you want the file contents to remain unchanged (meaning that you can't merely change whitespace as johnstok suggested) you can always change one of the properties on the file.
eg.
svn propset dummyproperty 1 yourfile svn commit yourfile
That will perform a commit without having to change the file.
Just make sure that you don't use one of the special svn:
properties. Anything else should be ok.
Edit: A number of other posters have asked why someone would want to do this - presumably the people who have marked this answer down have also had the same concerns.
I can't speak for the original poster, but one scenario where I have seen this used is when attempting to automatically synchronise activities on a Visual Sourcesafe repository with a subversion repository.
As to answer why one would like to do forced commits. I've seen cases where someone used a commit message that was wrong or unclear. It's nice if you can perform a forced commit, where you can correct this mistake. That way the updated commit message goes into the repository, so it won't get lost.
I frigged this by deleting then re-adding the offending file. Not the nicest way to do it, and it probably broke the revision history, but it suited my purposes.
Reason for wanting to do it: File was one of two executables built from the same source (with different #defines set). Minor change to source meant one had changed, one didn't. I wanted to record in the revision history that I had actually updated it to the latest version (even though there was no change).
Maybe Morten Holdflod Møller's point that "the file will still be a part of the new revision" would cover this indication, but I think a log of the unchanged file did not show comments for that revision.