30

I've been working on a development project using a Windows machine as a test server. Eventually, I'd like the "live" version to end up on a Linux machine. While trying to test on the Linux machine, it became apparent that I needed to change the case of several file names as Windows was case insensitive but Linux wasn't. When I changed the file name case in Windows, TortoiseSVN recognized that the file had changed and marked my folders appropriately. However, when I tried to commit my changes, not only did TortoiseSVN tell me that no changes had been made, but it had actually reverted all of the file name changes I had made back to their original case.

My question is, is there a simple way to alter the file name case from a Windows PC and have the changes appear in my repository? I'd like to avoid any kind of delete, commit, replace, commit scenario to keep my commits tidy if possible. Thanks!

Brad Turner
  • 438
  • 1
  • 4
  • 9
  • 1
    What's wrong with `svn ren` (rename)? In TSvn, right-click the file and choose `Rename` from the context menu. – Ken White Oct 06 '12 at 20:26

3 Answers3

31

Use Rename option in Tortoise SVN from popup menu. See details here ("Moving files and folders" chapter).

When you changed the case of several file names, in other words you changed file names - they have become out of version control - that's why SVN client noticed that files that was under version control had disappeared (apparently, that happened because SVN client wasn't informed properly).

If you happened to be in this situation when IDE or you changed the case accidently - there is special menu option Repair move which appears when you select both files that are shown as "missing" and "non-versioned". Check this.

pmod
  • 10,450
  • 1
  • 37
  • 50
  • 1
    Using the Rename option in Tortoise worked great! I was trying to simply rename the file in Windows Explorer. Thanks, pmod! – Brad Turner Oct 07 '12 at 05:12
  • 1
    I was stuck on this for a while till i realised you have to commit the folder, not the file. It might be worth adding that! – Ewanw Jan 09 '15 at 01:26
  • @Ewanw you should be able to commit selected files as well as the whole folder - this is up to the user. This is the same if you have only "one change", but in general case with selecting particular files you have better control on what should be committed. – pmod Jan 09 '15 at 09:04
  • When I try to update only the file I get an error from subversion. It is concerned because you're submitting the 'moved' file but not the deleted. It gives the error 'Cannot commit X because it was moved from Y which is not part of the commit; both sides of the move must be committed together' – Ewanw Jan 11 '15 at 22:32
21

I found that Tortoise SVN has a setting for auto fixing file name case changes. It is set to true by default, so if you only change the case of letters in the name then it will undo your changes for you... silently and ruthlessly I might add, very annoying default setting in my opinion.

Anyway luckily if you navigate to TortoiseSVN Settings->Advanced->FixCaseRenames you can change it to false and it will no longer auto correct case changes.Setting Location

  • THANK YOU! I was just trying to merge two branches and my devs created the same folder with different capitalization. I was about to go insane. – Chriszuma Jan 16 '18 at 21:50
  • 2
    WTF. Who thought it was a good idea to silently rename dozens of my files upon commit? Makes no sense. I'm not about to do dozens of svn renames -- heck you noticed the files were renamed so how about asking before renaming? Anyway, thanks! – Costa Aug 28 '18 at 02:14
  • You need to watch out for this if you have enabled Windows 10's SetCaseSensitiveInfo on the directory otherwise you will lose data when subversion renames the files. – aolszowka Mar 28 '19 at 13:57
1

If someone searches how to do this in SmartSVN on Windows (case-insensitive operating system), steps are:

  1. Select file in browser, in menu Modify -> Rename and use some temp name (e.g. add X to the end of the file name), commit changes
  2. Select file in browser, in menu Modify -> Rename and use the correct file name in correct case, commit changes

Only in such case the log of the file will be saved.

Andron
  • 6,413
  • 4
  • 43
  • 56