Gitignore文件可以有名字吗?
例如,您可以命名.gitignore
文件foo.gitignore
吗?
最终,目的是拥有多个.gitignore
用于不同的子项目类型的文件。
For example, can you name a .gitignore
file foo.gitignore
?
Ultimately, the purpose for this being to have multiple .gitignore
files for different sub-project types.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
简短答案:不,不是本地。
i content-filter驱动程序,结帐时,它将自动修改
.gitignore
使用其他文件的内容(例如foo.gitignore
)。但是,这需要本地设置激活该驱动程序
的含义:当您克隆存储库时,该机制将不会立即处于活动状态,而不是没有手册
git config
sptep。Short answer: no, not natively.
I suggested before a content-filter driver which, on checkout, would automatically modify a
.gitignore
with the content of other files (like afoo.gitignore
).However, that require a local setting to activate that driver
Meaning: when you clone the repository, that mechanism would not be immediately active, not without the manual
git config
step.不,不能。好吧,更确切地说,它可以具有 a 名称,但是该名称始终是
.gitignore
。(请注意,您也可以将条目存储在
.git/info/dublude
中,但这绝不是跟踪的文件,也不是投入。)No, it can't. Well, more precisely, it can have a name, but that name is always
.gitignore
.(Note that you can store entries in
.git/info/exclude
as well, but that is never a tracked file and does not get committed.)