git忽略Mac OS X上带有空格的目录 [英] git ignore for directories with spaces on Mac OS X

查看:163
本文介绍了git忽略Mac OS X上带有空格的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的 .gitignore 文件中添加一些模式来忽略由Xcode生成的* .mode1v3和* .pbxuser文件。但是,我的应用程序名称中有一个空格,所以我想要忽略的文件位于 Foo Bar.xcodeproj / 目录中。添加这些模式的变体似乎并不奏效:

I'm trying to add some patterns to my .gitignore file to ignore *.mode1v3 and *.pbxuser files generated by Xcode. However, my app name has a space in it, so the files I want to ignore are in the Foo Bar.xcodeproj/ directory. Adding variants of these patterns don't seem to work:

*.mode1v3
Foo Bar.xcodeproj/
Foo Bar.xcodeproj/*.mode1v3
Foo Bar.xcodeproj/username.mode1v3

.gitignore模式应该是什么?

What should the .gitignore patterns be?

推荐答案

AFAIK空间不是专门处理的; Pro Git和 gitignore(5) fnmatch(3)都没有提及它们。无论如何,第一个模式 *。mode1v3 是完全足够的;没有斜杠的模式应用于所有子目录。如果您想为特定子目录另外添加忽略模式,只需在该目录中放置一个专用的 .gitignore

AFAIK spaces aren't treated specially; neither Pro Git nor gitignore(5) nor fnmatch(3) mentions them. Anyway the first pattern *.mode1v3 is totally sufficient; patterns without slashes are applied to all subdirectories. If you want additional ignore patters for a specific subdirectory, just place a dedicated .gitignore in that directory.

这篇关于git忽略Mac OS X上带有空格的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆