I have an existing Maven project, which I used to create a new IntelliJ project (the "Import project from external model" option). I changed a few files and committed them.
Then I realized I was on the wrong branch (let's call it wrong
). I exited IDEA, used Tortoise SVN to switch to the correct branch (let's call it right
), and then re-opened IDEA. Everything seems fine, except that I now have a group in the Local tab of the Changes window called "Switched Files." This "Switched Files" has a subgroup called "branches/wrong" which appears to contain ALL the files in the entire repository! These files do not differ from the ones checked into right
, and most of them do not differ from the ones in wrong
, either. Yet here they are in my Changes window.
Moreover, these files do not show up in a Tortoise "Commit" window, but they do show up in a Tortoise "Check for modifications" window. But again, these files have not been modified, nor have any of their properties been modified, so far as I can tell.
What are "Switched Files" and how do I simply revert everything to the right
branch?
I just had a similar issue where after switching branches, one file was marked as "switched" for some reason.
I was able to fix this through IDEA by making sure I didn't any local changes, switching back to the "wrong" branch, then again switching to the "right" branch.
Note that I'm using IDEA to switch, rather than Tortoise.
Apparently this is just a Subversion thing. I was unaware of the concept of "switched" files. You can tell if some of your files are switched by using the command line:
$ svn st
S file1.txt
S file2.txt
The "switched" files will be marked with an 'S'. If you execute svn info
on one of these files, you will see that the URL listed does not match the URL of your current branch. See this SO post for more info.
I still don't know what it means really, or how it got into that state just by doing "Tortoise -> Switch...", but I do know how to fix it:
$ svn switch URL
Where URL
is the svn:// URL of the branch that you want to switch to. That should recursively scan all files and put them firmly on the "right" branch.
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