【问题标题】:git ignore file but not folder with the same namegit忽略文件但不忽略同名文件夹
【发布时间】:2018-08-31 10:13:31
【问题描述】:

我的代码结构是:

.gitignore
my-service << this is a file without an extention
charts
| my-service << this is a folder
| | file1
| | file2

当我在 gitignore my-service 中写入时,它会忽略 my-service 文件和 my-service 文件夹。 如何只忽略根目录中的文件,而不忽略子目录?

【问题讨论】:

标签: git gitignore


【解决方案1】:

您可以在 .gitignore 中使用! 进行相反的操作

myservice
!myservice/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-04-09
    • 2023-03-14
    • 1970-01-01
    • 1970-01-01
    • 2014-05-06
    • 2018-06-25
    • 2016-12-25
    相关资源
    最近更新 更多