git gitignore 忽略中间有空格的文件夹中的文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10213653/
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-10 13:30:10  来源:igfitidea点击:

gitignore ignore files within a folder that has whitespace in the middle

gitgithubgitignore

提问by Master Page

I have a folder that have a space in the middle, but have a webconfig file inside it. I want git to ignore the webconfig file but somehow it's not ignoring it because of the space in the folder. Anybody know how to work around this?

我有一个文件夹,中间有一个空格,但里面有一个 webconfig 文件。我希望 git 忽略 webconfig 文件,但由于文件夹中的空间,它并没有忽略它。有人知道如何解决这个问题吗?

My FolderName/Web.config

I tried to insert the %20in the middle but that did not help.

我试图%20在中间插入 ,但这没有帮助。

Thank you for your help.

感谢您的帮助。

回答by ch3ka

Try My\ FolderName/Web.configor "My FolderName/Web.config"

尝试My\ FolderName/Web.config"My FolderName/Web.config"

回答by lrAndroid

I'm guessing you probably have to use "My FolderName"/Web.configinstead.

我猜你可能不得不"My FolderName"/Web.config改用。