Mercurial 存储库和具有奇怪名称的文件
我有一个 Mercurial 存储库,其中有一个以“>>”结尾的文件。从此 Windows 存储库执行 hg 克隆时,出现以下错误:
abort: The filename, directory name, or volume label语法不正确:C:\Users\Path\To\Repos/More/Path/file>>
有办法解决吗?这似乎与 '>>' 有关尽管我也不确定为什么它从使用 \ 切换到 /,但对重定向感到困惑。
I have a mercurial repository, and inside it a file that ends with '>>'. When doing a hg clone from this windows repository, I get the following error:
abort: The filename, directory name, or volume label syntax is incorrect: C:\Users\Path\To\Repos/More/Path/file>>
Is there a way to fix it? It seems to do with the '>>' being confused for a redirect, although I'm also unsure of why it switched from using \ to /.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是在 Windows 上,文件名不能包含
>
符号。您可能应该尝试找到添加了相关文件的存储库的推送,并执行部分回滚以删除该文件。然后,永远不要再以这种方式命名文件:)编辑:您可以尝试从 Linux 计算机或虚拟机(如果有的话)执行拉取,然后重命名不包含奇怪字符的文件,然后提交并推回存储库。我不确定你是否已经尝试过。
The problem is that on Windows, a filename can't contain the
>
symbol. You should probably try and find the push to the repository that added the file in question and do a partial rollback to get rid of that file. Then, never name a file that way again :)EDIT: You might try performing a pull from a Linux machine or VM if you have it, and then renaming the file without the weird characters, then commit and push back to the repository. I'm not sure if you tried that already.