Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 730
pcorcoran Avatar asked Oct 15 '08 20:10

pcorcoran


People also ask

How do I commit changes to SVN repository?

Select any file and/or folders you want to commit, then TortoiseSVN → Commit.... The commit dialog will show you every changed file, including added, deleted and unversioned files. If you don't want a changed file to be committed, just uncheck that file.

Can we change the commit message in SVN?

By default, the log message property (svn:log) cannot be edited once it is committed. That is because changes to revision properties (of which svn:log is one) cause the property's previous value to be permanently discarded, and Subversion tries to prevent you from doing this accidentally.

How stop a commit in SVN?

To undo a specific revision you can use the following command: $ svn merge -c -r3745 . In case you have other edited files in working directory, you can commit only the relevant files. Please note that undoing actually will mean you create a new revision with the negatives changes of last commit.


2 Answers

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.

like image 73
Andrew Edgecombe Avatar answered Oct 02 '22 17:10

Andrew Edgecombe


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.

like image 45
user253217 Avatar answered Oct 02 '22 18:10

user253217