我有文件夹应用程序/,我添加到.gitignore。在应用程序/文件夹中是文件夹application/language/gr。我如何包含这个文件夹?
我试过了
application/
!application/language/gr/
我有文件夹应用程序/,我添加到.gitignore。在应用程序/文件夹中是文件夹application/language/gr。我如何包含这个文件夹?
我试过了
application/
!application/language/gr/
当前回答
我想跟踪jquery生产js文件,这是有效的:
node_modules/*
!node_modules/jquery
node_modules/jquery/*
!node_modules/jquery/dist/*
其他回答
因为很多程序员使用node。满足这个问题的用例是排除node_modules,除了一个模块module-a,例如:
!node_modules/
node_modules/*
!node_modules/module-a/
这招对我很管用:
**/.idea/**
!**/.idea/copyright/
!.idea/copyright/profiles_settings.xml
!.idea/copyright/Copyright.xml
在WordPress中,这帮助了我:
wp-admin/
wp-includes/
/wp-content/*
!wp-content/plugins/
/wp-content/plugins/*
!/wp-content/plugins/plugin-name/
!/wp-content/plugins/plugin-name/*.*
!/wp-content/plugins/plugin-name/**
我想跟踪位于/etc/nagios/中的Nagios配置文件以及/usr/lib64/ Nagios /plugins/中的插件。为此,我在/中初始化了一个git repo,并使用了以下排除列表:
/*
!etc
etc/*
!etc/nagios
!usr
usr/*
!usr/lib64
usr/lib64/*
!usr/lib64/nagios
usr/lib64/nagios/*
!usr/lib64/nagios/plugins
Git像这样遍历列表:
/* exclude everything under / ...
!etc but include /etc back
etc/* exclude everything under /etc/...
!etc/nagios but include /etc/nagios back
!usr but include /usr back
usr/* exclude everything under /usr/...
and so on...
添加一个名为.gitignore的文件到子文件夹,然后填充
!/Bin/
这对我很管用!