如何使用git还原来拆除名称包含点的文件
我要拆下一个名称包含点的文件。当我在下面命令下运行错误时,它会给我带来错误
git restore --staged MS0010-7(d.18) TSG Automated Buildouts - PaaSV2 buildout failed in initialize step due to DA could not ping any of the provided Service Fabric gateway endpoints-img001.png
: 术语“ d.18”不被认为是cmdlet,函数,脚本文件或可操作程序的名称。检查名称的拼写,或者如果包括路径,请验证该路径是否正确,然后重试。
有人可以指导我如何解决此错误并拆除此文件吗?谢谢。
I'm going to unstage a file which name contains dot. It game me a fetal error when I ran below command
git restore --staged MS0010-7(d.18) TSG Automated Buildouts - PaaSV2 buildout failed in initialize step due to DA could not ping any of the provided Service Fabric gateway endpoints-img001.png
with error :
The term 'd.18' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Could anybody guide me how to fix this error and unstage this file? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题不是点,而是括号
(
和)
d.18 被外壳解释。引用整个论点将阻止外壳解释字符串内的括号,这也将使整个字符串保持在内,包括一个参数: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about/about_quoting_rules?view=powershell-7.2“ /en-us/powershell/module/microsoft.powershell.core/about/about/about_quoting_rules?view=powsepowpowpowshell-7.2 ,错误消息的“ cmdlet”一部分是您可能使用powershell和不是powershell的提示UNIX壳。)
The problem is not the dot, but the parentheses
(
and)
aroundd.18
being interpreted by the shell. Quoting the whole argument will stop the shell from interpreting the parentheses inside the string, which will also keep the whole string including spaces as one argument:(This is going off my extensive knowledge of PowerShell which extends to quickly glancing at https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7.2, the "cmdlet" part of the error message being the hint that you are probably using PowerShell and not a Unix shell.)