Search code examples
svnphpstorm

Phpstorm, windows and subversion. Checking out a file with : in its name


So I just joined a new company, and am trying to check out a branch to my computer. Problem is, one of the files is titled essentially why::god::why.abc

While thats fine on linux, windows doesnt like that, and phpstorm is giving an error when trying to checkout the branch when it gets to that point, and wont let me continue past it.

Honestly, I have no need to work on that file, and can just ignore it. Things is, I go to file->settings->version controll->ignore list and add the entire directory tree where the file is in (there are only about 6 files in that directory tree, and atm i really dont need any of them) but it keeps failing with the same file.

Anyone have any ideas?


Solution

  • The problem is that you're using Windows, and Windows does not allow files to have : in their name. This has nothing to do with Subversion or PHPStorm itself. It's strictly a Windows issue.

    The only thing you can do is rename the offending file to remove the colon, or use an OS that allows colons in file names such as Linux or Mac OS X.

    To rename the file, use the svn move command:

    C:\> set REPO=http://svnhost/svn
    C:\> svn move %REPO%/trunk/path/to/bad/file/foo:bar %REPO%/truck/path/to/bad/file/foo_bar
    

    If you have your editor set, you should be able to create a commit message and rename the file this way. If not, add the -m"commit message" to the command. If the URL doesn't like the colon in the name, you may have to resort to using url-encoding by replacing the colon with a %3A:

    C:\> set REPO=http://svnhost/svn
    C:\> svn move %REPO%/trunk/path/to/bad/file/foo%3Abar %REPO%/truck/path/to/bad/file/foo_bar