问题
In my repository, I have two revisions. The src code is on revision 2, but I had a file that messed up, so I reverted it to revision 1.
After a few hours of debugging, that javafile works, but I can't commit it. SVN says that the javafile is out of date. This is probably because I'm editing javafile.java rev1, right?
How do I resolve this? I know I could copy/paste my modified javafile rev1 code into its rev2 counterpart, and then commit, but is there another way? Am I using SVN incorrectly?
回答1:
Updating the working copy should fix it.
From the command line:
X:\WorkingCopy>svn up
or right-click and choose SVN Update...
in TortoiseSVN
When you update, you may come across conflicts, which will be marked in your code with
>>>>>
...
-----
...
<<<<<
You'll need to manually resolve these. When you're done, don't forget to mark the file as resolved.
X:\WorkingCopy>svn resolve \path\to\file
or right-click and choose TortoiseSVN -> Mark as Resolved...
in TortoiseSVN
回答2:
I had this issue in Eclipse (Windows 10). It was solved by right clicking on the folder in question > Team > Update to HEAD
回答3:
Update your working copy, and resolve the merge conflicts by copying the resulting file that has your locally modified version over the version with conflict markers in in. Run svn resolved
on it, and check that in. This does assume there are no other changes that you want to preserve.
来源:https://stackoverflow.com/questions/1610897/how-can-i-fix-this-svn-commit-which-fails-as-out-of-date