我有文件夹应用程序/,我添加到.gitignore。在应用程序/文件夹中是文件夹application/language/gr。我如何包含这个文件夹?
我试过了
application/
!application/language/gr/
我有文件夹应用程序/,我添加到.gitignore。在应用程序/文件夹中是文件夹application/language/gr。我如何包含这个文件夹?
我试过了
application/
!application/language/gr/
当前回答
类似于这条评论,没有一个解决方案和模式适合我;强制git添加应该被排除的文件和文件夹,有效:
Git添加-f。
其他回答
我的JetBrains IntelliJ IDEA .gitignore配置,在那里我需要排除整个。IDEA文件夹除了。IDEA /runConfigurations:
.idea
!.idea/
.idea/*
!.idea/runConfigurations/
参见:https://github.com/daggerok/gitignore-idea-runConfigurations
添加一个名为.gitignore的文件到子文件夹,然后填充
!/Bin/
这对我很管用!
特别是对于较旧的Git版本,大多数建议都不能很好地工作。 如果是这种情况,我将在我希望包含内容的目录中放置一个单独的.gitignore,而不考虑其他设置,并允许其中包含所需的内容。
例如: / .gitignore
# ignore all .dll files
*.dll
/ dependency_files .gitignore
# include everything
!*
因此,/dependency_files中的所有内容(甚至是.dll文件)都被很好地包含在内。
类似于这条评论,没有一个解决方案和模式适合我;强制git添加应该被排除的文件和文件夹,有效:
Git添加-f。
因为很多程序员使用node。满足这个问题的用例是排除node_modules,除了一个模块module-a,例如:
!node_modules/
node_modules/*
!node_modules/module-a/