I made some changes and commited them (to version 2), and found out that they introduced new bugs to my program some minutes later. So I switched to some of the files to an older version to get some of the files back to version 1 on my local platform. Since then I have made a lot of changes I don't want to lose, and I have used commit (version 3) to get my local changes on the server.
The version I have locally is exactly what I want to be on the repository as head revision, even though some of the files are still officially on "version 1". I assume I should be using SVN merge in some way, but I'm not really sure how to do it. Any advice?
edit: When I use diff, it shows changes from the local version to the rep version. I could do update, but then I would have a non-working version locally again. So what I want is some kind of forced commit, that just says "this is the newest version, period".
edit2: When doing "commit", SVN reports that there are no changes. Thanks to Neil Butterworth for the question.
edit3: What I finally did, FYI: I should just have used Tim's suggestion, but I was dumb enough to do an update without really thinking about what I was doing. Of course, everything was then really messed up beyond repair. So what I finally did was to export the project to a new directory. That's obviously not the way you should do it, but I did not want to mess with this stuff any longer. In the end I had to get back to making actual progress on the actual project;-) I know that I can't do stuff like that when I'm working in a bigger team, but I'm not:)
Simply type svn update [name-of-directory] , or cd to that directory and type svn update there.
Subversion is pretty smart about updating and never just overwrites files that have local changes with copies from the repository. The most important thing to take away from this section is: If you collaborate with others on one repository, remember to update your working copy regularly.
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.
Brute force way:
If you did it correctly, the SVN client should interpret the changed files as updates to the repository. This will however overwrite any changes other people have made that you may want to keep. If you want to keep those changes, do a diff on all the files first and incorporate all the recent changes, before making the final commit.
Reverse merge back to original revision:
This is probably more manual unless you just revert everything back without checking for any changes.
Subversion, AFAIK, has no provision for an obliterate command yet, so all changes always happen to the local copy of the HEAD.
Reverting back is just a reverse merge, and all merges always happen on your local copy. In an ideal system, the merge will be tracked, but Subversion doesn't track merge information, so you might as well do method 1, and just make a comment in the commit log.
Some URLs to look up:
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