I would like to "overwrite" my last commit with the previous version. I tried to checkout the version 631, do some changes, and commit it as version 633. But svn doesn't agree, because version 632 exists.
What is the easiest way to do it? It is a multi-file commit. I don't want to make it manually.
The question is a bit old, but the answer may be useful for future reference:
Well, actually, one is not supposed to commit outdated files to SVN. The server itself refuses those files for security reason. One thing to do is to make an update from the last version, but keeping your "outdated" files during the merge process automatically:
svn up --accept mine-full
In other words, this will perform the update, but ignore any incoming merge.
If you can't do a REVERT to version 631, do the following:
I also want to have this feature. Why isn't there a command similar to svn commit --force-overwrite-new-version
?
Copy SVN revision 631 to SVN revision 633, and then you can commit your changes to SVN revision 634.
svn copy remote_url@631 remote_url
svn commit
P.S. Neither does git
have this feature. There is no such command as git merge foo --force-overwrite
.
Sometimes the requirement changes, so some code that is committed becomes useless. It happens really often, so overwriting code is vitally useful. I wonder why neither svn
nor git
has this feature. What a stupid design!!!
Instead of checking out 631, do a REVERT
to 631. Then you can change and check in.
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