How can I force subversion to commit an unchanged

2019-01-10 20:19发布

I want subversion to commit a file even if it's unchanged. Is there a way to do this?

11条回答
Emotional °昔
2楼-- · 2019-01-10 20:28

I have the same problem with a trueCrypt volume.

I added a new property (as suggested above) "forceCommit1" and them I was able to commit the volume file. but only the property was commited not the contents of the file.

I removed the file and added it again to the svn

查看更多
祖国的老花朵
3楼-- · 2019-01-10 20:29

Actually, I have come across a reason to do a force commit. This probably isn't best practice but we put Truecrypt (http://www.truecrypt.org/) volumes in SVN because we need to keep a tight security on some shell script as it contains sensitive information. When a Truecrypt volume is created, it's binary data stays the same no matter what you do with it. So in effect, I can change the contents of the volume but the volume never appears changed.

查看更多
爷的心禁止访问
4楼-- · 2019-01-10 20:30

Answering some people questioning this should be possible: for some reason svn doesn't recognizes differences between doc files, so I would like to force commit as well!

I am now moving documentation from static dirs, to svn. files are like UG_v1.2, UG_v1.3 etc. So just to keep history, I take 1.2, remove version from the filename and add and commit it to svn. Then I take the ver from the second one, copy it over the first one and want to commit it and newer version. File size and creation date changes (not mentioning what's inside the doc), but svn claims it's perfectly the same file and disallows me to commit. When I manually change the doc, svn sees the different. The heck? :>

查看更多
Fickle 薄情
5楼-- · 2019-01-10 20:31

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.

查看更多
Fickle 薄情
6楼-- · 2019-01-10 20:32

Changing the property will NOT force the commit.

TortoiseSVN 1.4.5, Build 10425 - 32 Bit , 2007/08/26 11:14:13

查看更多
淡お忘
7楼-- · 2019-01-10 20:33

If it's a text file just add some whitespace, such as a line feed.

查看更多
登录 后发表回答