在 Windows 上使用 TortoiseSVN 更改文件名大小写

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12763444/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 15:55:00  来源:igfitidea点击:

Changing Filename Case with TortoiseSVN on Windows

windowstortoisesvncase-sensitivecase-insensitive

提问by Brad Turner

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.

我一直在使用 Windows 机器作为测试服务器进行开发项目。最终,我希望“实时”版本最终出现在 Linux 机器上。在尝试在 Linux 机器上进行测试时,很明显我需要更改几个文件名的大小写,因为 Windows 不区分大小写,但 Linux 不是。当我在 Windows 中更改文件名大小写时,TortoiseSVN 识别出该文件已更改并适当地标记了我的文件夹。然而,当我尝试提交我的更改时,TortoiseSVN 不仅告诉我没有进行任何更改,而且实际上已经将我所做的所有文件名更改恢复为原始大小写。

My question is, is there a simple way to alter the file name case from a Windows PCand 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!

我的问题是,是否有一种简单的方法可以从 Windows PC更改文件名大小写并将更改显示在我的存储库中?如果可能的话,我想避免任何类型的删除、提交、替换、提交场景,以保持我的提交整洁。谢谢!

采纳答案by pmod

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

从弹出菜单中使用Tortoise SVN 中的重命名选项。请参阅此处的详细信息(“移动文件和文件夹”一章)。

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).

当您更改多个文件名的大小写时,换句话说,您更改了文件名 - 它们已经不受版本控制 - 这就是为什么 SVN 客户端注意到受版本控制的文件已经消失(显然,这是因为 SVN 客户端没有t 通知正确)。

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

如果您在 IDE 时碰巧遇到这种情况,或者您不小心更改了案例 -当您选择显示为“丢失”和“非版本化”的两个文件时,会出现特殊菜单选项修复移动。检查这个

回答by Lee Andy Cheneler

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.

我发现 Tortoise SVN 有一个自动修复文件名大小写更改的设置。它默认设置为 true,所以如果您只更改名称中字母的大小写,那么它会为您撤消您的更改......我可能会默默无情地添加,在我看来非常烦人的默认设置。

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

无论如何幸运的是,如果您导航到 TortoiseSVN Settings->Advanced->FixCaseRenames,您可以将其更改为 false,并且它将不再自动更正大小写更改。设置位置

回答by Andron

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

如果有人在 Windows上的SmartSVN(不区分大小写的操作系统)中搜索如何执行此操作,步骤是:

  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
  1. 在浏览器中选择文件,在菜单修改 -> 重命名并使用一些临时名称(例如在文件名的末尾添加 X),提交更改
  2. 在浏览器中选择文件,在菜单修改 -> 重命名并在正确的情况下使用正确的文件名,提交更改

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

只有在这种情况下,文件的日志才会被保存。